
Docker Compose v2 Has a Free API That Simplifies Multi-Container Deployments
Docker Compose v2 is a complete rewrite in Go — integrated directly into the Docker CLI as docker compose (no hyphen). It's 40% faster than v1 and adds watch mode, profiles, and GPU support. v1 vs v2: What Changed Feature v1 (Python) v2 (Go) Command docker-compose docker compose Speed Baseline 40% faster Watch mode No Yes GPU support No Yes Profiles No Yes Quick Start # compose.yaml (not docker-compose.yml!) services : web : build : . ports : - " 3000:3000" develop : watch : - action : sync path : ./src target : /app/src - action : rebuild path : package.json db : image : postgres:16 environment : POSTGRES_PASSWORD : secret volumes : - pgdata:/var/lib/postgresql/data volumes : pgdata : Watch Mode (Game-Changer) docker compose watch This watches your source code and automatically syncs changes into running containers — no manual rebuild needed. Three actions: sync (copy files), rebuild (rebuild image), sync+restart . Profiles — Run Only What You Need services : web : build : . debug : i
Continue reading on Dev.to DevOps
Opens in a new tab


