How do you do blue/green or canary deployments with plain Docker?
AdvancedProductionArchitecture & Design Decisions
Answer
Run app-blue and app-green as separate Compose projects on the same proxy network. Deploy to the idle color, health check it, then flip the proxy's upstream (Traefik label/weight or nginx upstream reload). For canary, weight 5% to the new color and watch error rates before shifting fully. Rollback is flipping back, since the old containers still run.
More on Architecture & Design Decisions
How would you design a container build-and-deploy pipeline from commit to production?AdvancedWhen should you use Docker Compose, Swarm, ECS, or Kubernetes?IntermediateHow do you decide how many processes belong in one container?BeginnerHow do you design the config strategy for containerized apps (12-factor)?IntermediateHow would you containerize a legacy app that writes to local disk and holds sessions in memory?AdvancedAlpine or Debian-slim for a Python service?Intermediate