Zero Downtime Deploy for Docker Apps, With Rollback
说明与用途
使用就绪门、稳定窗口和自动回滚实现无停机 Docker 部署,支持冻结窗口和即时回滚。
问题
Deploying Docker containers without service interruption while ensuring rollback capability.
结果
Zero‑downtime deployments with automatic rollback and freeze windows, reducing outage risk and simplifying rollback to a single command.
工作流
- Start new container
- Wait for readiness probe to pass twice in a row and run for 10 s
- If gate fails, keep old container serving and record failure reason
- Cut traffic to new release
- Drain old release for at least 15 s
- Hold previous release for instant rollback
- Watch new release for 5 min for failures
证据
Readiness gate before cutover – Traffic hitting a container that is not ready
A new container takes traffic only when its readiness probe passed twice in a row (APP_DEPLOY_SUCCESS_THRESHOLD) and it ran for 10 seconds (APP_DEPLOY_STABLE_WINDOW) without exiting, restarting or being OOM‑killed.
After a successful cutover, the previous release stays running. The hold is the longest of APP_DEPLOY_PREVIOUS_RELEASE_HOLD (3 minutes), the drain timeout and the post‑deploy watch window (5 minutes), so with defaults it lasts about 5 minutes.
- 记录日期: 2026-11-02T08:59:12.439Z