Zero downtime deployments with Docker, Caddy Server, and Bash
Jan 5, 2021
TLDR
- Pull your new docker image.
- Docker run “your-app-new” on a new port.
- Load balance your reverse proxy to 2 servers simultaneously: “your-app” and “your-app-new”.
- Send a graceful shutdown signal to “your-app”.
- Spin up the new docker image as “your-app”.
- Load your original Caddy config to only load balance to “your-app”.
- Shut down “your-app-new”.