Manage multiple environments with one Compose repo.
BeginnerScenarioCI/CD and production rollouts
Answer
Situation read → dev/staging/prod variants.
What I'd do → compose.yaml base + compose.<env>.yaml overrides, --env-file .env.<env>, and COMPOSE_PROJECT_NAME per environment so networks and volumes are separated. Validate with docker compose config.
Why → Project names isolate resources on the same host.
Interview tip → Use profiles for optional services (e.g., debug).
More on CI/CD and production rollouts
Design a GitHub Actions workflow that builds, scans and pushes an image.IntermediateZero-downtime deploy on a single Docker host.AdvancedDeploy via GitOps with image digests.IntermediateCanary a new image on a Swarm service.AdvancedDocker build is flaky in CI due to network errors on package installs.IntermediateRun database migrations in the deploy flow of containerized apps.Intermediate