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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFRyKxkKEjfAgpXygzoNiD
This commit is contained in:
Заид Омар Медхат | Zaid Omar Medhat 2026-07-11 01:53:15 +05:00
parent 71e39c7e88
commit 55825662d7

View file

@ -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: