fix(ci): connect job container to compose network for DB/MinIO access
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user