Fix Docker Swarm rolling update deadlock
Summary
- Switch from host-mode to ingress-mode port publishing for Swarm services
- Remove force-update step from deploy script
Problem
The previous configuration used mode: host for port publishing combined with order: start-first update strategy. This creates a deadlock:
-
start-firstrequires the new container to start before stopping the old -
mode: hostbinds ports directly to host, only allowing one container per port - New container cannot start because port is occupied by old container
- Old container won't stop until new one is running
Solution
Use ingress mode (the default) which routes traffic through Swarm's routing mesh. This allows multiple containers to coexist during updates, enabling proper zero-downtime rolling deployments.
Test plan
-
Deploy using
deploy-swarm.shwith a new version - Verify services update without downtime
- Check services are accessible during update