From d41aef0898b2509e8e2544f8fe94621b4fcd5089 Mon Sep 17 00:00:00 2001 From: trent Date: Mon, 10 Aug 2026 18:05:28 +0800 Subject: [PATCH] Fix: change dashboard port to prevent clashing --- .env.example | 2 +- .gitea/workflows/cd.yml | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 2bb6b6a..0bf0244 100644 --- a/.env.example +++ b/.env.example @@ -5,7 +5,7 @@ IMAGE_TAG=v1.0.0 # ---- exposed ports on the production host ---- API_PORT=5270 GATEWAY_PORT=5081 -DASHBOARD_PORT=8080 +DASHBOARD_PORT=8088 DASHBOARD_ORIGIN=https://vigilcare.example.com # ---- external PostgreSQL ---- diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml index 6469e35..6570c00 100644 --- a/.gitea/workflows/cd.yml +++ b/.gitea/workflows/cd.yml @@ -145,17 +145,26 @@ jobs: run: | ssh -i ~/.ssh/id_ed25519 \ "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" bash -euo pipefail <<'EOF' + cd /opt/vigilcare + set -a + # shellcheck disable=SC1091 + . ./.env + set +a + API_PORT="${API_PORT:-5270}" + GATEWAY_PORT="${GATEWAY_PORT:-5081}" + DASHBOARD_PORT="${DASHBOARD_PORT:-8080}" + for i in $(seq 1 30); do - if curl -fsS http://localhost:5270/health/ready >/dev/null; then + if curl -fsS "http://localhost:${API_PORT}/health/ready" >/dev/null; then echo "Ready check passed." - curl -fsS http://localhost:5081/health/live >/dev/null && echo "Gateway live." - curl -fsS http://localhost:8080/ >/dev/null && echo "Dashboard serving." + curl -fsS "http://localhost:${GATEWAY_PORT}/health/live" >/dev/null && echo "Gateway live." + curl -fsS "http://localhost:${DASHBOARD_PORT}/" >/dev/null && echo "Dashboard serving." exit 0 fi sleep 5 done echo "Ready check never passed — dumping API logs:" - docker compose -f /opt/vigilcare/docker-compose.prod.yml --env-file /opt/vigilcare/.env logs --tail 100 api + docker compose -f docker-compose.prod.yml --env-file .env logs --tail 100 api exit 1 EOF