-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
160 lines (153 loc) · 5.17 KB
/
Copy pathdocker-compose.yml
File metadata and controls
160 lines (153 loc) · 5.17 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
services:
postgres:
image: postgres:15-alpine
container_name: webapi-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ohdsi
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
networks:
- webapi-network
cdm-db:
image: ohdsi/broadsea-atlasdb:2.3.0
container_name: cdm-db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
networks:
- webapi-network
cdm-db-debug:
image: ohdsi/broadsea-atlasdb:2.3.0
container_name: cdm-db-debug
profiles: ["debug"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
ports:
- "5433:5432"
networks:
- webapi-network
mock-oauth2:
image: ghcr.io/navikt/mock-oauth2-server:2.1.10
container_name: mock-oauth2
environment:
- SERVER_PORT=9090
- JSON_CONFIG={"interactiveLogin":true,"httpServer":"NettyWrapper","tokenCallbacks":[{"issuerId":"default","tokenExpiry":3600,"requestMappings":[{"requestParam":"grant_type","match":"*","claims":{"sub":"testuser","email":"testuser@example.com","name":"Test User"}}]}]}
ports:
- "9090:9090"
networks:
- webapi-network
webapi:
build:
context: ../..
dockerfile: Dockerfile
container_name: webapi
restart: on-failure:3
depends_on:
postgres:
condition: service_healthy
cdm-db:
condition: service_healthy
mock-oauth2:
condition: service_started
environment:
- SERVER_SERVLET_CONTEXT_PATH=/WebAPI
- SPRING_DATASOURCE_HIKARI_CONNECTIONTIMEOUT=60000
- SPRING_DATASOURCE_HIKARI_INITIALIZATIONFAILTIMEOUT=60000
- DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
- DATASOURCE_USERNAME=postgres
- DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- DATASOURCE_OHDSI_SCHEMA=webapi
- SPRING_JPA_PROPERTIES_HIBERNATE_DEFAULT_SCHEMA=webapi
- SPRING_BATCH_REPOSITORY_TABLEPREFIX=webapi.BATCH_
- SPRING_FLYWAY_URL=jdbc:postgresql://postgres:5432/ohdsi
- SPRING_FLYWAY_USER=postgres
- SPRING_FLYWAY_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- SPRING_FLYWAY_SCHEMAS=webapi
- SPRING_FLYWAY_PLACEHOLDERS_OHDSISCHEMA=webapi
- SECURITY_PROVIDER=AtlasRegularSecurity
- SECURITY_AUTH_OIDC_ENABLED=true
- SECURITY_AUTH_DB_ENABLED=true
- SECURITY_AUTH_LDAP_ENABLED=false
- SECURITY_AUTH_AD_ENABLED=false
- SECURITY_AUTH_CAS_ENABLED=false
- SECURITY_AUTH_WINDOWS_ENABLED=false
- SECURITY_AUTH_KERBEROS_ENABLED=false
- SECURITY_AUTH_OAUTH_GOOGLE_ENABLED=false
- SECURITY_AUTH_OAUTH_FACEBOOK_ENABLED=false
- SECURITY_AUTH_OAUTH_GITHUB_ENABLED=false
- SECURITY_AUTH_OIDC_CLIENTID=webapi-client
- SECURITY_AUTH_OIDC_APISECRET=${OIDC_CLIENT_SECRET:-webapi-secret}
- SECURITY_AUTH_OIDC_URL=http://mock-oauth2:9090/default/.well-known/openid-configuration
- SECURITY_AUTH_OIDC_EXTERNALURL=http://localhost:9090/default
- SECURITY_AUTH_OIDC_LOGOUTURL=http://localhost:9090/default/endsession
- SECURITY_AUTH_OIDC_EXTRASCOPES=profile email
- SECURITY_AUTH_OAUTH_CALLBACK_UI=http://localhost:18080/WebAPI/#/welcome
- SECURITY_AUTH_OAUTH_CALLBACK_URLRESOLVER=query
- SECURITY_AUTH_DB_DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
- SECURITY_AUTH_DB_DATASOURCE_DRIVERCLASSNAME=org.postgresql.Driver
- SECURITY_AUTH_DB_DATASOURCE_USERNAME=postgres
- SECURITY_AUTH_DB_DATASOURCE_PASSWORD=${POSTGRES_PASSWORD:-postgres}
- SECURITY_AUTH_DB_DATASOURCE_SCHEMA=webapi
- SECURITY_JWT_SECRET=ci-test-jwt-secret-key-min-32chars!
- SECURITY_CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:18080
ports:
- "18080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/WebAPI/info"]
interval: 10s
timeout: 5s
retries: 30
start_period: 120s
networks:
- webapi-network
db-setup:
image: postgres:15-alpine
container_name: db-setup
depends_on:
webapi:
condition: service_healthy
volumes:
- ./setup-test-data.sql:/setup-test-data.sql:ro
environment:
PGPASSWORD: ${POSTGRES_PASSWORD:-postgres}
command: >
psql -h postgres -U postgres -d ohdsi -f /setup-test-data.sql
networks:
- webapi-network
newman:
image: postman/newman:6-alpine
container_name: newman
depends_on:
webapi:
condition: service_healthy
db-setup:
condition: service_completed_successfully
volumes:
- ./postman:/etc/newman
- ./test-results:/results
command:
- run
- /etc/newman/integration-tests.postman_collection.json
- --environment
- /etc/newman/integration-test-env.postman_environment.json
- --reporters
- cli,junit
- --reporter-junit-export
- /results/integration-test-results.xml
- --timeout-request
- "60000"
networks:
- webapi-network
networks:
webapi-network:
driver: bridge