Based on http://brianketelsen.com/2014/02/25/using-nginx-confd-and-docker-for-zero-downtime-web-updates/
Uses https://github.com/BlueDragonX/sentinel
Publishes all docker containers exposing 8080 to etcd key /myapp/upstream
Sentinel watches etcd key /myapp/upstream and updates nginx config on change
+---+sentinel
| +
| | +------+webapp
+ + |
etcd+--+nginx+-----+
|
+------+webapp
builds all containers, needs maven since we use a java webapp in this example
runs an etcd container, two webapp containers and a nginx container
publishes all containers exposing :8080 to etcd:/myapp/upstream
you can start/stop further webapp container and run
publish_nginx_containers.py
to see changes in nginx config
curl -I nginx-public-ip:80
Look for X-Upstream HTTP header