From 8267b30b151ab49f690b75afc8c52ecb19d6aa85 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 12:47:32 +0000 Subject: [PATCH] fix: restore app reachability after platform restart Two root causes: 1. Caddy was started without --resume, so every restart wiped all dynamically-registered app routes (only the base Caddyfile survived). Adding --resume makes Caddy reload its auto-saved config (stored in the caddy-config volume) which includes all app routes. 2. App routes used the container IP address, which changes whenever hiy-net is torn down and recreated by compose. Switch to the container name as the upstream dial address; Podman's aardvark-dns resolves it by name within hiy-net, so it stays valid across network recreations. Together with the existing reconnect loop in start.sh these two changes mean deployed apps survive a platform restart without needing a redeploy. https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH --- builder/build.sh | 4 +--- infra/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/builder/build.sh b/builder/build.sh index 78a7ad3..63389b5 100755 --- a/builder/build.sh +++ b/builder/build.sh @@ -113,9 +113,7 @@ CADDY_API="${CADDY_API_URL:-http://localhost:2019}" DOMAIN_SUFFIX="${DOMAIN_SUFFIX:-localhost}" if curl --silent --fail "${CADDY_API}/config/" >/dev/null 2>&1; then - CONTAINER_IP=$(podman inspect "$CONTAINER_NAME" \ - --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}') - UPSTREAM="${CONTAINER_IP}:${PORT}" + UPSTREAM="${CONTAINER_NAME}:${PORT}" log "Updating Caddy: ${APP_ID}.${DOMAIN_SUFFIX} → ${UPSTREAM}" # Discover actual server name (Caddyfile adapter names it 'srv0', not 'hiy'). diff --git a/infra/docker-compose.yml b/infra/docker-compose.yml index 78a5e47..32e1ad3 100644 --- a/infra/docker-compose.yml +++ b/infra/docker-compose.yml @@ -73,7 +73,7 @@ services: - ../proxy/Caddyfile:/etc/caddy/Caddyfile:ro - caddy-data:/data - caddy-config:/config - command: caddy run --config /etc/caddy/Caddyfile --adapter caddyfile + command: caddy run --config /etc/caddy/Caddyfile --adapter caddyfile --resume networks: - hiy-net - default