From 903ce3c8773ad53298f0f3c85c07a1d770ad1ef8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Jul 2026 07:28:57 +0000 Subject: [PATCH] Fix client 502/503 on deploy: start_period 60s + lb retries Same fix as dnd-management-nra#65/#66: - client's healthcheck start_period bumped from 30s to 60s to match server, giving Caddy's independent active health check enough time to confirm the new container before Swarm's start-first update retires the old one. - caddy.reverse_proxy.lb_try_duration/lb_retries added so a request landing on the old container while it drains after SIGQUIT (still "running" in Docker's eyes, but refusing new connections) transparently retries against the healthy upstream instead of surfacing 502/503. Co-Authored-By: Claude Sonnet 5 --- docker-compose-swarm.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose-swarm.yml b/docker-compose-swarm.yml index 825c81e6..32fd9981 100644 --- a/docker-compose-swarm.yml +++ b/docker-compose-swarm.yml @@ -13,6 +13,8 @@ services: caddy.reverse_proxy.health_uri: '/' caddy.reverse_proxy.health_interval: 5s caddy.reverse_proxy.health_timeout: 5s + caddy.reverse_proxy.lb_try_duration: 5s + caddy.reverse_proxy.lb_retries: 3 placement: constraints: - node.labels.codeserver != true @@ -33,7 +35,7 @@ services: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"] interval: 30s timeout: 10s - start_period: 30s + start_period: 60s retries: 3 environment: PORT: 80