-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.integration-test.yml
More file actions
110 lines (105 loc) · 4.08 KB
/
docker-compose.integration-test.yml
File metadata and controls
110 lines (105 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# SPDX-License-Identifier: EUPL-1.2
# Copyright (C) 2026 Gemeente Utrecht
#
# Integration test compose file.
# Starts postgres, minio, the cg-dmf API and runs the Bruno test suite.
#
# Usage (local):
# JWT_CLIENT_SECRET=<secret> docker compose -f docker-compose.integration-test.yml up --build --exit-code-from bruno
#
# The `bruno` service exits with code 0 on success or non-zero on failure.
# Test results (JUnit XML + HTML) are written to ./build/bruno-results/.
# Sets the Docker Compose project name, which controls the prefix used for all
# containers, networks and volumes created by this file (e.g. dmf-integration-test_postgres_1).
# Override on the command line with: docker compose -p my-name -f ...
name: dmf-integration-test
services:
postgres:
container_name: dmf-it-postgres
image: postgres:16-alpine
environment:
POSTGRES_DB: documenten
POSTGRES_USER: documenten
POSTGRES_PASSWORD: documenten
healthcheck:
test: [ 'CMD-SHELL', 'pg_isready -U documenten' ]
interval: 5s
timeout: 5s
retries: 10
minio:
container_name: dmf-it-minio
image: minio/minio:latest
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --address ":9000"
healthcheck:
test: [ 'CMD-SHELL', 'curl -sf http://localhost:9000/minio/health/live' ]
interval: 5s
timeout: 5s
retries: 10
app:
container_name: dmf-it-app
# Build the full image from source (same as production).
# Locally this may take a few minutes on first run; subsequent runs use the Docker layer cache.
build: .
ports:
- 8080:8080
environment:
DB_URL: jdbc:postgresql://postgres:5432/documenten
DB_USER: documenten
DB_PASSWORD: documenten
BLOB_STORAGE_TYPE1: S3
BLOB_STORAGE_NAME1: minio-local
BLOB_STORAGE_URL1: http://minio:9000
BLOB_STORAGE_ACCESS_KEY1: minioadmin
BLOB_STORAGE_SECRET_KEY1: minioadmin
BLOB_STORAGE_BUCKET1: documenten-local
BLOB_STORAGE_TYPE2: S3
BLOB_STORAGE_NAME2: minio-archive
BLOB_STORAGE_URL2: http://minio:9000
BLOB_STORAGE_ACCESS_KEY2: minioadmin
BLOB_STORAGE_SECRET_KEY2: minioadmin
BLOB_STORAGE_BUCKET2: documenten-archive
ZGW_ALLOWED_CLIENT_IDS: gzac
OIDC_ISSUER: ${OIDC_ISSUER:-https://auth.gzac.baseflow.com/realms/valtimo}
OPENZAAK_CLIENT_SECRET: ${OPENZAAK_CLIENT_SECRET:-}
BESTANDSDELEN_TRIGGER_SIZE: ${BESTANDSDELEN_TRIGGER_SIZE:-100000}
BESTANDSDELEN_CHUNK_SIZE: ${BESTANDSDELEN_CHUNK_SIZE:-100000}
ENCRYPTION_SECRET_KEY: ${ENCRYPTION_SECRET_KEY:-changeme-use-a-strong-key-in-production}
ENCRYPTION_SALT: ${ENCRYPTION_SALT:-deadbeefcafe0123456789abcdef0123}
WOPI_ENABLED: true
WOPI_SLAT_SECRET: ${WOPI_SLAT_SECRET:-changeme-use-a-strong-key-in-production}
healthcheck:
test: [ 'CMD-SHELL', 'wget -qO- http://localhost:8080/health/liveness || exit 1' ]
interval: 5s
timeout: 5s
retries: 20
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
bruno:
container_name: dmf-it-bruno
image: node:20-alpine
working_dir: /collection/CG-DMF
volumes:
- ./.bruno:/collection
- ./build/bruno-results:/results
environment:
JWT_CLIENT_SECRET: ${JWT_CLIENT_SECRET:-your-secret}
# Set to 'false' in CI so the container exits after the tests finish (needed for --exit-code-from).
BRUNO_KEEP_ALIVE: ${BRUNO_KEEP_ALIVE:-false}
# Install dependencies and run the collection against the CI environment.
# Results are written to /results (mapped to ./build/bruno-results/ on the host).
entrypoint: /bin/sh
command: >-
-c "npm install && npx @usebruno/cli run --env CI --sandbox=developer
--env-var 'jwt.clientSecret=$$JWT_CLIENT_SECRET' --reporter-junit
/results/results.xml --reporter-html /results/output.html; BRUNO_EXIT=$$?;
if [ \"$$BRUNO_KEEP_ALIVE\" = 'true' ]; then tail -f /dev/null; fi; exit
$$BRUNO_EXIT"
depends_on:
app:
condition: service_healthy