Last active
March 4, 2024 19:23
-
-
Save typewriter/82ebed0df1fc6f7c1e360cfbf8d9b903 to your computer and use it in GitHub Desktop.
Zero downtime deployment reproduction using traefik
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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