From 208dc87d694bd6514029a75d6ec1f572759ef97b Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 19 Mar 2026 14:00:51 +0100 Subject: [PATCH] fix(ci): connect job container to compose network for DB/MinIO access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The act_runner job runs inside a Docker container. Docker Compose port mappings bind to the Docker host, not the job container's localhost — so localhost:5433 was always refused. Fix: after compose starts, connect the job container (identified by /etc/hostname) to the archive-net compose network. Then switch the backend startup args to use service names db:5432 and minio:9000 instead of host-mapped ports. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e060c25f..2f348f5c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -117,7 +117,10 @@ jobs: - name: Wait for DB to be ready run: | timeout 30 bash -c \ - 'until docker compose exec -T db pg_isready -U archive_user; do sleep 2; done' + 'until docker compose -f docker-compose.yml -f docker-compose.ci.yml exec -T db pg_isready -U archive_user; do sleep 2; done' + + - name: Connect job container to compose network + run: docker network connect familienarchiv_archive-net $(cat /etc/hostname) # ── Backend ───────────────────────────────────────────────────────────── - uses: actions/setup-java@v4 @@ -142,10 +145,10 @@ jobs: run: | java -jar backend/target/*.jar \ --spring.profiles.active=e2e \ - --SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5433/family_archive_db \ + --SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/family_archive_db \ --SPRING_DATASOURCE_USERNAME=archive_user \ --SPRING_DATASOURCE_PASSWORD=ci_db_password \ - --S3_ENDPOINT=http://localhost:9100 \ + --S3_ENDPOINT=http://minio:9000 \ --S3_ACCESS_KEY=minio_admin \ --S3_SECRET_KEY=ci_minio_password \ --S3_BUCKET_NAME=archive-documents \