forked from os2datascanner/os2datascanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
459 lines (426 loc) · 13.1 KB
/
docker-compose.yml
File metadata and controls
459 lines (426 loc) · 13.1 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
version: '3.9'
services:
db:
image: postgres:12
env_file:
- dev-environment/db.env
volumes:
- postgres-data:/var/lib/postgresql/data
- ./docker/postgres-initdb.d/10-test-for-valid-env-variables.sh:/docker-entrypoint-initdb.d/10-test-for-valid-env-variables.sh
- ./docker/postgres-initdb.d/20-create-admin-db-and-user.sh:/docker-entrypoint-initdb.d/20-create-admin-db-and-user.sh
- ./docker/postgres-initdb.d/40-create-report-db-and-user.sh:/docker-entrypoint-initdb.d/40-create-report-db-and-user.sh
# The following file adds the CREATEDB privilege to the db users to enable it
# to run the django tests.
# THIS SHOULD NOT BE USED IN PRODUCTION!!!
- ./dev-environment/postgres-initdb.d/50-add-createdb-permissions.sh:/docker-entrypoint-initdb.d/50-add-createdb-permissions.sh
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 3
start_period: 30s
queue:
# Normally, we expect the `rabbitmq` image. The -management images come
# with a set of management plugins installed and enabled by default.
# They can be accessed through the web interface on port 15672 (or the port
# it has been remapped to).
# The credentials are given in the specified `rabbitmq.env` file.
image: rabbitmq:3.8-management-alpine
hostname: os2datascanner_msg_broker
env_file:
- dev-environment/rabbitmq.env
ports:
- "5672:5672"
- "8030:15672"
admin_frontend:
build:
context: .
dockerfile: docker/admin/Dockerfile
target: frontend
volumes:
- ./src/os2datascanner/projects/admin/adminapp/static/src:/code/src/os2datascanner/projects/admin/adminapp/static/src
- frontend-bundles-admin:/code/src/os2datascanner/projects/admin/adminapp/static/dist/
- /code/frontend/mode_modules
report_frontend:
build:
context: .
dockerfile: docker/report/Dockerfile
target: frontend
volumes:
- ./src/os2datascanner/projects/report/reportapp/static/src:/code/src/os2datascanner/projects/report/reportapp/static/src
- frontend-bundles-report:/code/src/os2datascanner/projects/report/reportapp/static/dist/
- /code/frontend/mode_modules
admin_application:
build:
context: .
dockerfile: docker/admin/Dockerfile
target: application
command: [
"gunicorn",
"--config", "/code/docker/gunicorn-settings.py",
"--reload", # restart workers when code changes
"wsgi"
]
environment:
- GUNICORN_WORKERS=2
volumes:
- frontend-bundles-admin:/code/src/os2datascanner/projects/admin/adminapp/static/dist/
- ./dev-environment/admin/dev-settings.toml:/user-settings.toml
- ./dev-environment/admin/.secret:/code/.secret
- ./src/os2datascanner:/code/src/os2datascanner
ports:
- "8020:5000"
depends_on:
- db
- admin_frontend
- queue
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
interval: 5s
timeout: 5s
retries: 3
start_period: 40s
admin_collector:
build:
context: .
dockerfile: docker/admin/Dockerfile
target: application
environment:
- OS2DS_SKIP_DJANGO_MIGRATIONS=1
command: python manage.py pipeline_collector
volumes:
- ./dev-environment/admin/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- db
- admin_application
- queue
admin_job_runner:
restart: unless-stopped
build:
context: .
dockerfile: docker/admin/Dockerfile
target: application
environment:
- OS2DS_SKIP_DJANGO_MIGRATIONS=1
command: python manage.py run_background_jobs
volumes:
- ./dev-environment/admin/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- db
- admin_application
- queue
report_application:
build:
context: .
dockerfile: docker/report/Dockerfile
target: application
command: [
"gunicorn",
"--config", "/code/docker/gunicorn-settings.py",
"--reload", # restart workers when code changes
"wsgi"
]
environment:
- GUNICORN_WORKERS=2
volumes:
- frontend-bundles-report:/code/src/os2datascanner/projects/report/reportapp/static/dist/
- ./dev-environment/report/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
ports:
- "8040:5000"
depends_on:
- db
- report_frontend
- queue
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
interval: 5s
timeout: 5s
retries: 3
start_period: 40s
# channel layer backend
redis:
restart: unless-stopped
image: redis:latest
profiles:
- socket
report_collector:
build:
context: .
dockerfile: docker/report/Dockerfile
target: application
environment:
- OS2DS_SKIP_DJANGO_MIGRATIONS=1
command: python manage.py pipeline_collector
volumes:
- ./dev-environment/report/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- db
- report_application
- queue
engine_explorer:
build:
context: .
dockerfile: docker/engine/Dockerfile
target: engine
command: explorer --enable-metrics
init: true
volumes:
- ./dev-environment/engine/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- queue
engine_worker:
build:
context: .
dockerfile: docker/engine/Dockerfile
target: engine
command: worker --enable-metrics
init: true
volumes:
- ./dev-environment/engine/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- queue
engine_exporter:
build:
context: .
dockerfile: docker/engine/Dockerfile
target: engine
command: exporter --enable-metrics
init: true
volumes:
- ./dev-environment/engine/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- queue
# a11y is short for "accessibility". There are 11 chars between a-y
a11y_scanner:
build:
context: ./services/a11y-scanner
dockerfile: docker/Dockerfile
env_file:
- ./dev-environment/a11y-scanner/a11y-scanner.env
# Set only the necessary security permissions
security_opt:
- seccomp:./services/a11y-scanner/chrome_seccomp.json
ports:
- 8888:8888
profiles:
- a11y
api_server:
build:
context: .
dockerfile: docker/api/Dockerfile
target: application
command: [
"gunicorn",
"--config", "/code/docker/gunicorn-settings.py",
"--workers", "2", # only two workers in local dev - to save some resources
"--reload", # restart workers when code changes
"os2datascanner.server.wsgi"
]
ports:
- "8070:5000"
volumes:
- ./dev-environment/api/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
profiles:
- api
swagger_ui:
image: swaggerapi/swagger-ui:v3.41.1
environment:
- SWAGGER_JSON_URL=http://localhost:8070/openapi.yaml
ports:
- "8075:8080"
depends_on:
- api_server
profiles:
- api
prometheus:
image: prom/prometheus
volumes:
- "./dev-environment/prometheus.yml:/etc/prometheus/prometheus.yml:ro"
ports:
- "8050:9090"
profiles:
- metric
# default user is admin/admin
grafana:
image: grafana/grafana
volumes:
- "./dev-environment/grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro"
- "./dev-environment/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro"
ports:
- "8060:3000"
profiles:
- metric
idp:
image: magentalabs/simplesamlphp:2.0.1
environment:
- SIMPLESAMLPHP_BASEURLPATH=http://localhost:8080/simplesaml/
- SIMPLESAMLPHP_SP_ENTITY_ID=http://localhost:8040/saml2_auth/acs/
- SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localhost:8040/saml2_auth/acs/
# Replace the three env variables above with these below, if you wish to test Keycloak.
# - SIMPLESAMLPHP_SP_ENTITY_ID=http://localkeycloak.os2datascanner:8090/auth/realms/magenta
# - SIMPLESAMLPHP_SP_ASSERTION_CONSUMER_SERVICE=http://localkeycloak.os2datascanner:8090/auth/realms/magenta/broker/saml/endpoint
# - SIMPLESAMLPHP_SP_SINGLE_LOGOUT_SERVICE=http://localkeycloak.os2datascanner:8090/auth/realms/magenta/broker/saml/endpoint
volumes:
- ./dev-environment/authsources.php:/var/www/simplesamlphp/config/authsources.php
ports:
- "8080:8080"
profiles:
- sso
postgres-keycloak:
image: postgres
environment:
POSTGRES_DB: keycloak
POSTGRES_USER: keycloak
POSTGRES_PASSWORD: keycloak
volumes:
- type: volume
source: knr-postgres-keycloak-volume
target: /var/lib/postgresql/data
profiles:
- ldap
- sso
localkeycloak.os2datascanner:
image: quay.io/keycloak/keycloak:12.0.0
# Import of realm is done with migration commands below
# because we need to predefine the Master realm.
# Using the KEYCLOAK_IMPORT env variable or the -Dkeycloak.import flag will not
# work, as it will create a Master realm, then try but fail to create a
# new Master realm from our json file.
# migration.strategy=OVERWRITE_EXISTING will drop & create if changes has occurred
# and is set to our default setting.
# IGNORE_EXISTING will not import if a realm of this name already exists
# which could be useful if you need to test other Keycloak settings.
command: [ "-Djboss.socket.binding.port-offset=10",
"-Dkeycloak.migration.action=import",
"-Dkeycloak.migration.provider=singleFile",
"-Dkeycloak.migration.file=/realm.json",
"-Dkeycloak.migration.strategy=IGNORE_EXISTING",
]
ports:
- 8090:8090
environment:
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
# PROXY_ADDRESS_FORWARDING: "true"
DB_USER: keycloak
DB_PASSWORD: keycloak
DB_ADDR: postgres-keycloak
DB_DATABASE: keycloak
DB_SCHEMA: public
DB_VENDOR: POSTGRES
volumes:
- ./dev-environment/realm.json:/realm.json
depends_on:
- postgres-keycloak
profiles:
- ldap
- sso
ldap_server:
image: osixia/openldap
environment:
LDAP_ADMIN_PASSWORD: testMAG
LDAP_BASE_DN: dc=magenta,dc=test
LDAP_ORGANISATION: Magenta
LDAP_DOMAIN: magenta.test
ports:
- 389:389
volumes:
- ldap_data:/var/lib/ldap
- ldap_config:/etc/ldap/slapd.d
profiles:
- ldap
ldap_server_admin:
image: osixia/phpldapadmin
ports:
- 8100:80
environment:
PHPLDAPADMIN_LDAP_HOSTS: ldap_server
PHPLDAPADMIN_HTTPS: 'false'
depends_on:
- ldap_server
profiles:
- ldap
x-disabled:
admin_cron:
build:
context: .
dockerfile: docker/admin/Dockerfile
target: application
command: supercronic /code/docker/crontab
environment:
- OS2DS_SKIP_DJANGO_MIGRATIONS=1
volumes:
- ./dev-environment/admin/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- db
- admin_application
- queue
report_cron:
build:
context: .
dockerfile: docker/report/Dockerfile
target: application
command: supercronic /code/docker/crontab
environment:
- OS2DS_SKIP_DJANGO_MIGRATIONS=1
volumes:
- ./dev-environment/report/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- db
- report_application
- queue
engine_processor:
build:
context: .
dockerfile: docker/engine/Dockerfile
target: engine
command: processor --enable-metrics
init: true
volumes:
- ./dev-environment/engine/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- queue
engine_matcher:
build:
context: .
dockerfile: docker/engine/Dockerfile
target: engine
command: matcher --enable-metrics
init: true
restart: unless-stopped
volumes:
- ./dev-environment/engine/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- queue
engine_tagger:
build:
context: .
dockerfile: docker/engine/Dockerfile
target: engine
command: tagger --enable-metrics
init: true
volumes:
- ./dev-environment/engine/dev-settings.toml:/user-settings.toml
- ./src/os2datascanner:/code/src/os2datascanner
depends_on:
- queue
volumes:
frontend-bundles-admin:
frontend-bundles-report:
postgres-data:
postgres-initdb.d:
knr-postgres-keycloak-volume:
ldap_data:
ldap_config: