Skip to content

Commit

Permalink
feat: Add load balancing retries
Browse files Browse the repository at this point in the history
Adding lb_try_duration in an attempt to make the deployments completely
without downtime

Based on [caddy's
docs](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#lb_try_duration)
  • Loading branch information
sivertschou committed Feb 6, 2025
1 parent 8d6af6a commit 013ee5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/deploy/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ services:
caddy: ${BASE_URL}
caddy.reverse_proxy: '/api* {{upstreams 8080}}'
caddy.reverse_proxy.lb_policy: 'cookie'
caddy.reverse_proxy.lb_try_duration: 5s
caddy.tls.dns: 'cloudflare ${CLOUDFLARE_DNS_API_TOKEN}'

frontend-green:
Expand All @@ -45,6 +46,7 @@ services:
labels:
caddy: ${BASE_URL}
caddy.reverse_proxy: '{{upstreams 80}}'
caddy.reverse_proxy.lb_try_duration: 5s
caddy.tls.dns: 'cloudflare ${CLOUDFLARE_DNS_API_TOKEN}'

backend-blue:
Expand Down Expand Up @@ -83,6 +85,7 @@ services:
caddy: ${BASE_URL}
caddy.reverse_proxy: '/api* {{upstreams 8080}}'
caddy.reverse_proxy.lb_policy: 'cookie'
caddy.reverse_proxy.lb_try_duration: 5s
caddy.tls.dns: 'cloudflare ${CLOUDFLARE_DNS_API_TOKEN}'

frontend-blue:
Expand All @@ -94,6 +97,7 @@ services:
labels:
caddy: ${BASE_URL}
caddy.reverse_proxy: '{{upstreams 80}}'
caddy.reverse_proxy.lb_try_duration: 5s
caddy.tls.dns: 'cloudflare ${CLOUDFLARE_DNS_API_TOKEN}'

postgres:
Expand Down

0 comments on commit 013ee5f

Please sign in to comment.