Zero-downtime deploys with plain Docker Compose
You do not need Kubernetes to deploy without dropping requests.
Most small projects do not need an orchestrator. A single VPS with Docker Compose handles a surprising amount of traffic.
The idea
Run two copies of the app behind Nginx, update them one at a time, and only send traffic to healthy instances.
upstream app {
server 127.0.0.1:8001;
server 127.0.0.1:8002;
}Things that bite
- Database migrations must remain backward-compatible.
- Health checks should test real dependencies.
- Keep the prior image tag for a quick rollback.