All Posts
DockerDevOpsDeployment
January 28, 2025

Zero-Downtime Deployments on a Budget

You do not need Kubernetes for zero-downtime deployments. Here is how to achieve it with Docker Compose and a reverse proxy.

The Strategy

Run two instances of your application behind a reverse proxy. Deploy the new version to the standby instance, health-check it, then switch traffic. Drain the old instance. Done.

With Traefik

Traefik makes this almost automatic. Label your containers with routing rules, and Traefik handles the rest. When a new container starts and passes health checks, traffic routes to it.

The Rolling Update Script

A 40-line bash script that scales up, waits for health, scales down, and prunes old images. Simple, reliable, and running in production for over a year with zero incidents.

When You Actually Need Kubernetes

If you have 50+ services, need multi-region deployment, or require auto-scaling based on load. For everything else, Docker Compose and a good reverse proxy are enough.

Written by

Shyam