Skip to content

[Phase 1.3] Add services orchestration (docker-compose style) #276

Description

@loonghao

Parent Issue

Part of #273 - .vx.toml v2 Configuration Enhancement

Objective

Add local development services orchestration similar to docker-compose.

Configuration Format

[services.database]
image = "postgres:16"
ports = ["5432:5432"]
env = { POSTGRES_PASSWORD = "dev", POSTGRES_DB = "app" }
volumes = ["./data/postgres:/var/lib/postgresql/data"]
healthcheck = "pg_isready -U postgres"

[services.redis]
image = "redis:7-alpine"
ports = ["6379:6379"]

[services.app]
command = "npm run dev"
depends_on = ["database", "redis"]
ports = ["3000:3000"]
env_file = ".env.local"
working_dir = "./src"

Tasks

  • Define ServiceConfig structure
  • Implement vx services start [name] command
  • Implement vx services stop [name] command
  • Implement vx services status command
  • Implement vx services logs [name] command
  • Add dependency resolution (depends_on)
  • Add health check support
  • Support both Docker and Podman
  • Generate docker-compose.yml from config
  • Add unit tests

Commands

vx services start          # Start all services
vx services start database # Start specific service
vx services stop           # Stop all services
vx services status         # Show service status
vx services logs redis     # Show service logs
vx services export         # Generate docker-compose.yml

Acceptance Criteria

  • Services start in dependency order
  • Health checks work correctly
  • Logs are accessible
  • Works with both Docker and Podman
  • vx services export generates valid docker-compose.yml

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions