Add pv service — containerized service management#24
Merged
munezaclovis merged 6 commits intomainfrom Mar 6, 2026
Merged
Conversation
Introduce `pv service` commands for managing backing services (MySQL, PostgreSQL, Redis, RustFS) via Colima + Docker Engine. Users never interact with Docker or Colima directly — pv manages everything. Foundation: - Config paths for services dir, Colima binary, Docker socket - Registry extended with ServiceInstance, ProjectServices, service CRUD - Service definitions with port schemes, health checks, env vars - Dotenv read/write/merge helper for .env auto-wiring - Colima binary management (download, start/stop, profile isolation) - Docker Engine wrapper (container.CreateOpts with health config) Commands: - pv service add <name> [version] — pull image, create container, wait healthy - pv service list — table with service, status, port, projects - pv service start/stop [service] — start/stop one or all - pv service remove <service> — stop + remove container, keep data - pv service destroy <service> — stop + remove + delete data (no prompt) - pv service status <service> — detailed info - pv service env [service] — print connection env vars - pv service logs <service> — tail container logs Integrations: - pv link: auto-detect services from .env, bind to project, create DB - pv doctor: services health section (Colima, Docker, containers) - pv install: download Colima binary alongside PHP - pv uninstall: stop service containers and Colima before cleanup Tests: - Registry service CRUD + backward compat (old JSON loads fine) - Service definitions: ports, images, container names, env vars - Dotenv merge: replace in-place, append new, backup original - E2E scripts for service lifecycle and auto-wiring
Service commands now skip container operations when Colima isn't installed, allowing the registry plumbing to work independently. This fixes E2E failures on GitHub Actions where Colima is not available. Updated E2E assertions to match actual output patterns.
Colima release assets use different arch naming per platform: - Darwin: colima-Darwin-arm64, colima-Darwin-x86_64 - Linux: colima-Linux-aarch64, colima-Linux-x86_64 The previous code mapped arm64 -> aarch64 unconditionally, which produced a 404 on macOS (colima-Darwin-aarch64 doesn't exist).
Colima may be installed but unable to start (e.g. no virtualization on GH Actions runners). Service add/start now degrade gracefully: the service is registered in the registry even when the container runtime is unavailable. Also improved E2E script to print command output on failure for better debugging, and added service diagnostics to the dump script.
macOS GH Actions runners don't support nested VMs, so Colima/Docker can never run there. Service functionality is covered by unit tests.
- Add WebRoutes() to Service interface for *.pv.{tld} subdomain routing
- Generate Caddy reverse_proxy configs for service HTTP endpoints
- Rename rustfs service to s3 (image stays rustfs/rustfs under the hood)
- Add mail service backed by Mailpit (SMTP :1025, web UI :8025)
- Wire Caddy config regeneration into service add/remove/destroy
- Auto-detect MAIL_HOST in pv link for mail service binding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pv servicecommands for managing backing services (MySQL, PostgreSQL, Redis, RustFS) via Colima + Docker Enginepv link(auto-detect services from.env),pv doctor(health checks),pv install(Colima download), andpv uninstall(teardown)New commands
pv service add <name> [version]— pull image, create container, wait healthypv service list— table with service, status, port, projectspv service start/stop [service]— start/stop one or allpv service remove <service>— stop + remove container, keep datapv service destroy <service>— stop + remove + delete data (no prompt)pv service status <service>— detailed infopv service env [service]— print connection env varspv service logs <service>— tail container logsKey decisions
latesttag when no version specifiedpv service destroyhas no confirmation prompt33000+patch, PostgreSQL54000+major, Redis6379, RustFS9000/9001Test plan
go test ./...— all existing + new tests passservicesfield loads finescripts/e2e/services.sh— full service lifecyclescripts/e2e/service-link.sh— auto-wiring duringpv link