-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
132 lines (127 loc) · 4.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
132 lines (127 loc) · 4.47 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
services:
postgres:
image: postgres:15-alpine
container_name: webapi-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: ohdsi
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
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
mock-oauth2:
condition: service_started
environment:
- SPRING_DATASOURCE_HIKARI_CONNECTIONTIMEOUT=60000
- SPRING_DATASOURCE_HIKARI_INITIALIZATIONFAILTIMEOUT=60000
- DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
- DATASOURCE_USERNAME=postgres
- DATASOURCE_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
- SPRING_FLYWAY_SCHEMAS=webapi
- SPRING_FLYWAY_PLACEHOLDERS_OHDSISCHEMA=webapi
- SECURITY_PROVIDER=AtlasRegularSecurity
- SECURITY_AUTH_OPENID_ENABLED=true
- SECURITY_AUTH_JDBC_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_GOOGLE_ENABLED=false
- SECURITY_AUTH_FACEBOOK_ENABLED=false
- SECURITY_AUTH_GITHUB_ENABLED=false
- SECURITY_OID_CLIENTID=webapi-client
- SECURITY_OID_APISECRET=webapi-secret
- SECURITY_OID_URL=http://mock-oauth2:9090/default/.well-known/openid-configuration
- SECURITY_OID_EXTERNALURL=http://localhost:9090/default
- SECURITY_OID_LOGOUTURL=http://localhost:9090/default/endsession
- SECURITY_OID_EXTRASCOPES=profile email
- SECURITY_OAUTH_CALLBACK_UI=http://localhost:18080/WebAPI/#/welcome
- SECURITY_OAUTH_CALLBACK_API=http://localhost:18080/WebAPI/user/oauth/callback
- SECURITY_OAUTH_CALLBACK_URLRESOLVER=query
- SECURITY_DB_DATASOURCE_URL=jdbc:postgresql://postgres:5432/ohdsi
- SECURITY_DB_DATASOURCE_DRIVERCLASSNAME=org.postgresql.Driver
- SECURITY_DB_DATASOURCE_USERNAME=postgres
- SECURITY_DB_DATASOURCE_PASSWORD=postgres
- SECURITY_DB_DATASOURCE_SCHEMA=webapi
- SECURITY_DB_DATASOURCE_AUTHENTICATIONQUERY=select password, firstname, middlename, lastname from webapi.users where lower(email) = lower(?)
- LOGGING_LEVEL_ORG_OHDSI_WEBAPI_SECURITY=DEBUG
- LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_SECURITY=DEBUG
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-users.sql:/setup-test-users.sql:ro
environment:
PGPASSWORD: postgres
command: >
psql -h postgres -U postgres -d ohdsi -f /setup-test-users.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/auth-tests.postman_collection.json
- --environment
- /etc/newman/auth-test-env.postman_environment.json
- --reporters
- cli,junit
- --reporter-junit-export
- /results/auth-test-results.xml
networks:
- webapi-network
networks:
webapi-network:
driver: bridge