Zero-downtime deploy on a single Docker host.
AdvancedScenarioCI/CD and production rollouts
Answer
Situation read → No orchestrator available.
What I'd do → Blue/green with a reverse proxy: start the new version as api-green, wait for healthy, switch the proxy upstream (Traefik label or nginx include + nginx -s reload), drain and stop api-blue. Tools such as docker rollout plugin or Compose + Traefik automate this.
Why → Proxy switch is atomic; old containers finish in-flight requests.
Interview tip → Also mention DB migrations must be backward compatible.
More on CI/CD and production rollouts
Design a GitHub Actions workflow that builds, scans and pushes an image.IntermediateDeploy 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.IntermediateHow do you keep dev, CI and prod consistent?Beginner