Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Zero downtime deployment reproduction using traefik
version: "3"
services:
traefik:
image: "traefik:v2.2"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
command:
- "--providers.docker=true"
- "--api.insecure=true"
- "--entryPoints.web.address=:80"
- "--serversTransport.forwardingTimeouts.dialTimeout=1s"
- "--serversTransport.forwardingTimeouts.responseHeaderTimeout=5s"
nginx-blue:
image: "nginx:alpine"
stop_signal: SIGQUIT
labels:
- "traefik.http.routers.nginx-bg.rule=Host(`localhost`)"
- "traefik.http.routers.nginx-bg.middlewares=nginx-retry"
- "traefik.http.services.nginx-bg.loadbalancer.server.port=80"
- "traefik.http.middlewares.nginx-retry.retry.attempts=4"
nginx-green:
image: "nginx:alpine"
stop_signal: SIGQUIT
labels:
- "traefik.http.routers.nginx-bg.rule=Host(`localhost`)"
- "traefik.http.routers.nginx-bg.middlewares=nginx-retry"
- "traefik.http.services.nginx-bg.loadbalancer.server.port=80"
- "traefik.http.middlewares.nginx-retry.retry.attempts=4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.