|
| 1 | +# Test infrastructure for DesktopApplicationClientJava integration tests. |
| 2 | +# |
| 3 | +# Mirrors the contract of the backend (pks-java) compose file: same services, |
| 4 | +# same ports, same environment variable names (see .env.example). |
| 5 | +# Run only ONE stack at a time (this one OR the backend one) — ports overlap. |
| 6 | +# |
| 7 | +# Default: postgres + redis (enough for auth/resource/user/admin ITs): |
| 8 | +# docker compose up -d |
| 9 | +# With object storage (for file/export ITs): |
| 10 | +# docker compose --profile files up -d |
| 11 | + |
| 12 | +services: |
| 13 | + postgres: |
| 14 | + image: postgres:16-alpine |
| 15 | + environment: |
| 16 | + - POSTGRES_DB=${POSTGRES_DB} |
| 17 | + - POSTGRES_USER=${POSTGRES_USER} |
| 18 | + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} |
| 19 | + ports: |
| 20 | + - '5432:5432' |
| 21 | + volumes: |
| 22 | + - postgres_data:/var/lib/postgresql/data |
| 23 | + restart: unless-stopped |
| 24 | + healthcheck: |
| 25 | + test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] |
| 26 | + interval: 10s |
| 27 | + timeout: 5s |
| 28 | + retries: 5 |
| 29 | + |
| 30 | + redis: |
| 31 | + image: redis:7-alpine |
| 32 | + ports: |
| 33 | + - '6379:6379' |
| 34 | + volumes: |
| 35 | + - redis_basic_data:/data |
| 36 | + restart: unless-stopped |
| 37 | + healthcheck: |
| 38 | + test: ["CMD", "redis-cli", "ping"] |
| 39 | + interval: 10s |
| 40 | + timeout: 5s |
| 41 | + retries: 5 |
| 42 | + |
| 43 | + minio: |
| 44 | + image: quay.io/minio/minio |
| 45 | + profiles: [files] |
| 46 | + command: server /data --console-address ":9001" |
| 47 | + environment: |
| 48 | + - MINIO_ROOT_USER=${MINIO_ROOT_USER} |
| 49 | + - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD} |
| 50 | + ports: |
| 51 | + - '9000:9000' # S3 API |
| 52 | + - '9001:9001' # Web Console |
| 53 | + volumes: |
| 54 | + - minio_data:/data |
| 55 | + restart: unless-stopped |
| 56 | + healthcheck: |
| 57 | + test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/live || exit 1"] |
| 58 | + interval: 10s |
| 59 | + timeout: 5s |
| 60 | + retries: 5 |
| 61 | + |
| 62 | + minio-init: |
| 63 | + image: minio/mc:latest |
| 64 | + profiles: [files] |
| 65 | + depends_on: |
| 66 | + minio: |
| 67 | + condition: service_healthy |
| 68 | + entrypoint: > |
| 69 | + /bin/sh -c " |
| 70 | + mc alias set myminio http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}; |
| 71 | + mc mb myminio/${MINIO_BUCKET_NAME} --ignore-existing; |
| 72 | + mc admin user add myminio ${MINIO_ACCESS_TOKEN} ${MINIO_SECRET_KEY}; |
| 73 | + mc admin policy attach myminio readwrite --user ${MINIO_ACCESS_TOKEN}; |
| 74 | + exit 0; |
| 75 | + " |
| 76 | +
|
| 77 | +volumes: |
| 78 | + redis_basic_data: |
| 79 | + postgres_data: |
| 80 | + driver: local |
| 81 | + minio_data: |
| 82 | + driver: local |
0 commit comments