From a1cd748e0f1cbab3944e83a416af510a5a33ec01 Mon Sep 17 00:00:00 2001 From: Nicholas Ceballos Date: Mon, 1 Jun 2026 17:03:24 -0600 Subject: [PATCH] ci(gitea): update health check to use container IP remove published port mapping and use docker-inspected internal container IP for health checks to avoid port conflicts and reduce exposed network ports --- .gitea/workflows/ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index daaef0f..acb2645 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -76,11 +76,10 @@ jobs: -e GIT_COMMIT=${{ gitea.sha }} \ -e GIT_BRANCH=${{ gitea.ref_name }} \ -e DEPLOY_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ - -p 8080:80 \ ci-image:latest - + CI_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ci-test) for i in $(seq 1 12); do - if curl -sf http://localhost:8080/health > /dev/null 2>&1; then + if curl -sf http://$CI_IP/health > /dev/null 2>&1; then echo "::notice::Health check passed" docker logs ci-test 2>&1 || true docker stop ci-test @@ -89,13 +88,12 @@ jobs: fi sleep 5 done - echo "::error::Health check failed after 60 seconds" docker logs ci-test 2>&1 || true docker stop ci-test docker rm ci-test exit 1 - + - name: Move cache run: | set -euo pipefail