
Docker Compose v2 Has Free Multi-Container Orchestration — Replace Your Bash Scripts with YAML
Docker Compose v2: What Changed? Docker Compose v2 is a complete rewrite in Go (v1 was Python). It's now a Docker CLI plugin — docker compose instead of docker-compose . Faster, more reliable, and supports profiles. Quick Start # compose.yaml (v2 uses this filename by default) services : api : build : ./api ports : - " 3000:3000" environment : - DATABASE_URL=postgres://user:pass@db:5432/mydb depends_on : db : condition : service_healthy db : image : postgres:16-alpine environment : POSTGRES_PASSWORD : pass POSTGRES_DB : mydb volumes : - pgdata:/var/lib/postgresql/data healthcheck : test : [ " CMD-SHELL" , " pg_isready -U postgres" ] interval : 5s timeout : 3s retries : 5 redis : image : redis:7-alpine ports : - " 6379:6379" volumes : pgdata : docker compose up -d docker compose logs -f api docker compose down Profiles: Dev vs Production services : api : build : ./api ports : - " 3000:3000" db : image : postgres:16-alpine # Only starts with: docker compose --profile debug up adminer : i
Continue reading on Dev.to Tutorial
Opens in a new tab



