From b456c8f1bd447fb2fcbc54f87d37426bc9adbb4a Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 17 Mar 2026 21:41:58 +0100 Subject: [PATCH 1/2] ci: free host ports before starting e2e infrastructure Port 5432 was already in use after docker compose cleanup because a system-level PostgreSQL service on the runner host holds the port. Also kill any stray containers binding to 5432/9000/9001. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a90ccf9c..d4200eda 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -83,8 +83,15 @@ jobs: - uses: actions/checkout@v4 # ── Infrastructure ────────────────────────────────────────────────────── - - name: Cleanup leftover containers from previous runs - run: docker compose down --volumes --remove-orphans + - name: Cleanup leftover containers and free ports + run: | + docker compose down --volumes --remove-orphans || true + # Stop system-level PostgreSQL if present (host service can occupy port 5432) + sudo systemctl stop postgresql || true + # Kill any remaining container still binding to our ports + for port in 5432 9000 9001; do + docker ps -q --filter "publish=$port" | xargs -r docker stop || true + done - name: Start DB and MinIO run: docker compose up -d db minio create-buckets -- 2.49.1 From 5f36930b6b0a56a988da8c60c38fb4232956292d Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 17 Mar 2026 21:44:09 +0100 Subject: [PATCH 2/2] ci: use non-standard ports for DB and MinIO in e2e job Avoids conflicts with any system services (PostgreSQL, MinIO) that may already occupy 5432/9000/9001 on the runner host. DB: 5433, MinIO API: 9100, MinIO console: 9101. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d4200eda..dfdf2fb6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -73,9 +73,9 @@ jobs: MINIO_ROOT_USER: minio_admin MINIO_ROOT_PASSWORD: ci_minio_password MINIO_DEFAULT_BUCKETS: archive-documents - PORT_DB: 5432 - PORT_MINIO_API: 9000 - PORT_MINIO_CONSOLE: 9001 + PORT_DB: 5433 + PORT_MINIO_API: 9100 + PORT_MINIO_CONSOLE: 9101 PORT_BACKEND: 8080 PORT_FRONTEND: 3000 @@ -83,15 +83,8 @@ jobs: - uses: actions/checkout@v4 # ── Infrastructure ────────────────────────────────────────────────────── - - name: Cleanup leftover containers and free ports - run: | - docker compose down --volumes --remove-orphans || true - # Stop system-level PostgreSQL if present (host service can occupy port 5432) - sudo systemctl stop postgresql || true - # Kill any remaining container still binding to our ports - for port in 5432 9000 9001; do - docker ps -q --filter "publish=$port" | xargs -r docker stop || true - done + - name: Cleanup leftover containers from previous runs + run: docker compose down --volumes --remove-orphans || true - name: Start DB and MinIO run: docker compose up -d db minio create-buckets @@ -118,10 +111,10 @@ jobs: run: | java -jar backend/target/*.jar \ --spring.profiles.active=e2e \ - --SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/family_archive_db \ + --SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5433/family_archive_db \ --SPRING_DATASOURCE_USERNAME=archive_user \ --SPRING_DATASOURCE_PASSWORD=ci_db_password \ - --S3_ENDPOINT=http://localhost:9000 \ + --S3_ENDPOINT=http://localhost:9100 \ --S3_ACCESS_KEY=minio_admin \ --S3_SECRET_KEY=ci_minio_password \ --S3_BUCKET_NAME=archive-documents \ -- 2.49.1