From 22a9fc13f77338f00169003d3adae4a392634cb3 Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 28 Jul 2026 23:00:19 +0200 Subject: [PATCH] fix(deploy): use correct PORT for health check (was hardcoded to 3000, env uses 3002) The health check URL was hardcoded to http://127.0.0.1:3000 but the production .env sets PORT=3002. Read the PORT from .env dynamically so the health check matches the actual server port. --- .gitea/workflows/deploy.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 084cd96d..13d012fc 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -389,8 +389,9 @@ jobs: exit 1 fi - echo "Waiting for HTTP health check..." - HEALTH_URL="${DEPLOY_HEALTH_URL:-http://127.0.0.1:3000/api/health}" + DEPLOY_PORT="$(grep -E '^[[:space:]]*PORT=.+' "${LIVE}/.env" 2>/dev/null | cut -d= -f2 | tr -d '"' || echo '3002')" + echo "Waiting for HTTP health check on port ${DEPLOY_PORT}..." + HEALTH_URL="${DEPLOY_HEALTH_URL:-http://127.0.0.1:${DEPLOY_PORT}/api/health}" HEALTH_OK=0 for i in $(seq 1 15); do BODY="$(curl -sf --max-time 5 "${HEALTH_URL}" 2>/dev/null || true)"