From 77ee80d3f19d1baf83f0fbf8c3790aca2daa5506 Mon Sep 17 00:00:00 2001 From: Xika Date: Fri, 4 Dec 2026 10:16:28 +0000 Subject: [PATCH] fix(deploy): configurable health check URL for deploy-hook container (BIT-33898) The deploy-pull.sh health check used 127.0.0.1:8000 which doesn't reach the API from inside the deploy-hook container (separate network namespace). Add HEALTH_CHECK_URL env var so the container can use http://api:8000 via Docker DNS. Also add .git-credentials to .gitignore for the credential file mounted into the deploy-hook container. Paperclip-Issue: BIT-33898 Paperclip-Agent: nelson-baptista --- .gitignore | 3 +++ deploy/deploy-pull.sh | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d66e991..beaf070 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,9 @@ processed_emails.json storage/deploy-logs/* !storage/deploy-logs/.gitkeep +# Git credentials (deploy-hook container) +.git-credentials + # OS .DS_Store Thumbs.db diff --git a/deploy/deploy-pull.sh b/deploy/deploy-pull.sh index c214493..c2b427e 100644 --- a/deploy/deploy-pull.sh +++ b/deploy/deploy-pull.sh @@ -66,12 +66,13 @@ log "Building API + worker ($GIT_SHA)" $COMPOSE build --build-arg GIT_SHA="$GIT_SHA" web remove_stale_service_containers web $COMPOSE up -d --force-recreate web + HEALTH_URL="${HEALTH_CHECK_URL:-http://127.0.0.1:8000/api/health}" for i in 1 2 3 4 5; do - curl -sf --max-time 8 http://127.0.0.1:8000/api/health >/dev/null && break + curl -sf --max-time 8 "$HEALTH_URL" >/dev/null && break log "API not ready yet (attempt $i/5), retrying in 5s..." sleep 5 done - curl -sf --max-time 8 http://127.0.0.1:8000/api/health >/dev/null + curl -sf --max-time 8 "$HEALTH_URL" >/dev/null write_status "ok $GIT_SHA $(date -Iseconds)" log "Deploy OK ($GIT_SHA)" log "Refreshing deploy-hook (self-restart — runs detached)"