I’ve been keen to move some of my web services from CI to CD recently, and I was keen to see if it could be done using zero-downtime techniques. In other words, I wanted to run a minimum of two instances, to restart each one independently, and then to use a networking system to route around containers that are undergoing an update. It turns out that Docker Swarm has the features I need: replicas, rolling updates and the routing mesh.
My work and documentation are in this repo – as usual, feedback is welcome.