From 55825662d7281ad535cf42c8839018070ba1ac3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=97=D0=B0=D0=B8=D0=B4=20=D0=9E=D0=BC=D0=B0=D1=80=20?= =?UTF-8?q?=D0=9C=D0=B5=D0=B4=D1=85=D0=B0=D1=82=20=7C=20Zaid=20Omar=20Medh?= =?UTF-8?q?at?= Date: Sat, 11 Jul 2026 01:53:15 +0500 Subject: [PATCH] infra: self-heal nginx after unordered stack restarts A concurrent restart (docker compose restart / Docker Desktop) can start nginx before the backend's DNS entry exists; "host not found in upstream" is fatal at config load and left the gateway dead (502s). restart: unless-stopped retries until dependencies are up. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BFRyKxkKEjfAgpXygzoNiD --- docker-compose.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index cede6a4..0a28673 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -137,6 +137,10 @@ services: nginx: image: nginx:1.27-alpine + # Restart on failure: a concurrent stack restart can start nginx before the + # backend's DNS entry exists ("host not found in upstream"), which is fatal + # at config load — retrying once dependencies are up self-heals the gateway. + restart: unless-stopped volumes: - ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro depends_on: