From e077fdec0702eaa763065236b761c056ac4bbb46 Mon Sep 17 00:00:00 2001 From: JosueDev-afk Date: Mon, 1 Jun 2026 20:37:35 -0600 Subject: [PATCH] ci: use random host port to avoid conflict with existing services --- .gitea/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 00793cf..ae15631 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: docker stop ci-test || true docker rm ci-test || true docker run -d --name ci-test \ - --network host \ + -p 0:80 \ -e APP_ENV=ci \ -e APP_VERSION=ci-${{ gitea.sha }} \ -e BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ @@ -78,8 +78,9 @@ jobs: -e GIT_BRANCH=${{ gitea.ref_name }} \ -e DEPLOY_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ ci-image:latest + CI_PORT=$(docker port ci-test 80 | cut -d: -f2) for i in $(seq 1 12); do - if curl -sf http://localhost:80/health > /dev/null 2>&1; then + if curl -sf http://localhost:$CI_PORT/health > /dev/null 2>&1; then echo "::notice::Health check passed" docker logs ci-test 2>&1 || true docker stop ci-test