-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
501 lines (477 loc) · 12.8 KB
/
docker-compose.yml
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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
services:
oidc:
profiles: ["sda-sweden"]
container_name: oidc
command:
- /bin/sh
- -c
- |
pip install -q --upgrade pip
pip install -q aiohttp Authlib joserfc requests
sh make_oidc_jwt.sh
python -u /oidc.py
healthcheck:
test: ["CMD", "python3", "-c", 'import requests; print(requests.get(url = "http://localhost:8080/jwk").text)']
interval: 10s
timeout: 2s
retries: 6
image: python:3.11-slim
ports:
- "8085:8080"
restart: always
volumes:
- ./scripts/oidc.py:/oidc.py
- ./scripts/sign_jwt.py:/sign_jwt.py
- ./scripts/make_oidc_jwt.sh:/make_oidc_jwt.sh
- shared:/shared
postgres:
profiles: ["sda-sweden"]
container_name: postgres
environment:
- POSTGRES_PASSWORD=rootpasswd
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 2s
retries: 6
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}-postgres
ports:
- "5432:5432"
volumes:
- dbdata:/var/lib/postgresql/data
rabbitmq:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}-rabbitmq
container_name: rabbitmq
environment:
- RABBITMQ_DEFAULT_PASS=test
- RABBITMQ_DEFAULT_USER=test
- MQ_VHOST=sda
ports:
- "15672:15672"
- "5672:5672"
healthcheck:
test: ["CMD", "bash", "-c", "rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms"]
interval: 5s
timeout: 120s
retries: 10
s3:
profiles: ["sda-sweden"]
command: server /data --console-address ":9001"
container_name: s3
environment:
- MINIO_ROOT_USER=access
- MINIO_ROOT_PASSWORD=secretkey
- MINIO_SERVER_URL=http://127.0.0.1:9000
healthcheck:
test:
["CMD", "curl", "-fqI", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 20s
retries: 10
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
createbucket:
profiles: ["sda-sweden"]
image: minio/mc
container_name: mc
depends_on:
s3:
condition: service_started
entrypoint: >
/bin/sh -c "
sleep 10;
/usr/bin/mc -q config host add s3 http://s3:9000 access secretkey;
/usr/bin/mc -q mb s3/inbox || true;
/usr/bin/mc -q mb s3/archive || true;
/usr/bin/mc -q mb s3/backup || true;
exit 0;
"
s3inbox:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-s3inbox ]
container_name: s3inbox
depends_on:
oidc:
condition: service_healthy
s3:
condition: service_started
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: always
environment:
- LOG_LEVEL=debug
- BROKER_ROUTINGKEY=inbox
- SERVER_JWTPUBKEYPATH=/keys/
- SERVER_JWTPUBKEYURL=http://oidc:8080/jwk
- LOG_FORMAT=json
volumes:
- ./config.yaml:/config.yaml
- ./keys:/keys
ports:
- "8000:8000"
- "8001:8001"
ingest:
profiles: ["sda-sweden"]
container_name: ingest
depends_on:
postgres:
condition: service_started
rabbitmq:
condition: service_healthy
s3:
condition: service_started
bootstrap:
condition: service_started
environment:
- BROKER_QUEUE=ingest
- BROKER_ROUTINGKEY=archived
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-ingest ]
volumes:
- ./config.yaml:/config.yaml
- keys:/keys
restart: always
verify:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-verify ]
container_name: verify
depends_on:
postgres:
condition: service_started
rabbitmq:
condition: service_healthy
s3:
condition: service_started
environment:
- BROKER_QUEUE=archived
- BROKER_ROUTINGKEY=verified
volumes:
- ./config.yaml:/config.yaml
- keys:/keys
restart: always
finalize:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-finalize ]
container_name: finalize
depends_on:
postgres:
condition: service_started
rabbitmq:
condition: service_healthy
environment:
- BROKER_QUEUE=accession
- BROKER_ROUTINGKEY=completed
volumes:
- ./config.yaml:/config.yaml
- keys:/keys
restart: always
sync:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-sync ]
container_name: sync
depends_on:
postgres:
condition: service_started
rabbitmq:
condition: service_healthy
s3:
condition: service_started
environment:
- BROKER_QUEUE=mapping_stream
# uncomment for sftp inbox
# - SYNC_DESTINATION_TYPE=sftp
# - SYNC_DESTINATION_SFTP_HOST=sftp-serverfin
# - SYNC_DESTINATION_SFTP_PORT=22
# - SYNC_DESTINATION_SFTP_USERNAME=user
# - SYNC_DESTINATION_SFTP_HOSTKEY=
# - SYNC_DESTINATION_SFTP_PEMKEYPATH=/keys-sftp/sftp-key.pem
# - SYNC_DESTINATION_SFTP_PEMKEYPASS=test
volumes:
- ./config.yaml:/config.yaml
- keys:/keys
# uncomment for sftp inbox
# - ./keys-sftp:/keys-sftp
restart: always
sync-api:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-syncapi ]
container_name: sync-api
depends_on:
rabbitmq:
condition: service_healthy
environment:
- SYNC_API_INGESTROUTING=ingest
- SYNC_API_ACCESSIONROUTING=accession
- SYNC_API_MAPPINGROUTING=mappings
ports:
- "18080:8080"
restart: always
volumes:
- ./config.yaml:/config.yaml
mapper:
profiles: ["sda-sweden"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-mapper ]
container_name: mapper
depends_on:
postgres:
condition: service_started
rabbitmq:
condition: service_healthy
environment:
- BROKER_QUEUE=mappings
volumes:
- ./config.yaml:/config.yaml
- keys:/keys
restart: always
bootstrap:
profiles: ["sda-sweden"]
depends_on:
createbucket:
condition: service_completed_successfully
command: sh -c /bin/bootstrap.sh -p /keys/c4gh.pub
container_name: bs
image: neicnordic/sda-helm-tests-support:latest
user: 0:0
volumes:
- $PWD/scripts/bootstrap.sh:/bin/bootstrap.sh
- keys:/keys
# Finnish implementation
postgresfin:
profiles: ["sda-finland"]
container_name: postgresfin
environment:
- POSTGRES_PASSWORD=rootpasswd
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 2s
retries: 6
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}-postgres
ports:
- "5431:5432"
volumes:
- dbdatafin:/var/lib/postgresql/data
rabbitmqfin:
profiles: ["sda-finland"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}-rabbitmq
container_name: rabbitmqfin
environment:
- RABBITMQ_DEFAULT_PASS=test
- RABBITMQ_DEFAULT_USER=test
- MQ_VHOST=sda
ports:
- "15674:15672"
- "5674:5672"
healthcheck:
test: [ "CMD", "bash", "-c", "rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms"]
interval: 5s
timeout: 120s
retries: 10
# uncomment for sftp inbox
# sftp-serverfin:
# profiles: ["sda-finland"]
# build:
# context: dev_utils/sftp-server
# hostname: sftp-serv
# environment:
# - SFTP_USER=user
# - SFTP_USER_PASS=user
# - DELETE_UPLOADED_FILES=false
# - FILE_CHECK_INTERVAL=0
# - FILE_AGE=0.01 #minutes
# - SFTP_USER_PUB_KEY=/keys/sftp-key.pub
# container_name: sftp-server
# ports:
# - "6222:22"
# volumes:
# - inboxfin:/uploads
# - ./keys-sftp:/keys
s3fin:
profiles: ["sda-finland"]
command: server /data --console-address ":9001"
container_name: s3fin
environment:
- MINIO_ROOT_USER=access
- MINIO_ROOT_PASSWORD=secretkey
- MINIO_SERVER_URL=http://127.0.0.1:9000
healthcheck:
test: ["CMD", "curl", "-fq", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 20s
retries: 3
image: minio/minio
ports:
- "9003:9000"
- "9004:9001"
createbucketfin:
profiles: ["sda-finland"]
image: minio/mc
container_name: mcfin
depends_on:
s3fin:
condition: service_started
entrypoint: >
/bin/sh -c "
sleep 10;
/usr/bin/mc -q config host add s3 http://s3fin:9000 access secretkey;
/usr/bin/mc -q mb s3/inbox || true;
/usr/bin/mc -q mb s3/archive || true;
/usr/bin/mc -q mb s3/sync || true;
exit 0;
"
ingestfin:
profiles: ["sda-finland"]
container_name: ingestfin
depends_on:
postgresfin:
condition: service_started
rabbitmqfin:
condition: service_healthy
s3fin:
condition: service_started
# uncomment for sftp inbox
# sftp-serverfin:
# condition: service_started
bootstrapfin:
condition: service_started
environment:
# uncomment for sftp inbox
# - INBOX_TYPE=posix
# - INBOX_LOCATION=/uploads/user/upload
- BROKER_QUEUE=ingest
- BROKER_ROUTINGKEY=archived
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-ingest ]
volumes:
# uncomment for sftp inbox
# - inboxfin:/uploads
- ./configfin.yaml:/config.yaml
- keys:/keys
# uncomment if using POSIX filesystem
# - archivefin:/tmp
restart: always
verifyfin:
profiles: ["sda-finland"]
command: sda-verify
container_name: verifyfin
depends_on:
postgresfin:
condition: service_started
rabbitmqfin:
condition: service_healthy
s3fin:
condition: service_started
# uncomment for sftp inbox
# sftp-serverfin:
# condition: service_started
environment:
- BROKER_QUEUE=archived
- BROKER_ROUTINGKEY=verified
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
volumes:
- ./configfin.yaml:/config.yaml
- keys:/keys
# uncomment if using POSIX filesystem
# - archivefin:/tmp
restart: always
finalizefin:
profiles: ["sda-finland"]
command: sda-finalize
container_name: finalizefin
depends_on:
postgresfin:
condition: service_started
rabbitmqfin:
condition: service_healthy
environment:
- BROKER_QUEUE=accession
- BROKER_ROUTINGKEY=completed
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
volumes:
- ./configfin.yaml:/config.yaml
- keys:/keys
# uncomment if using POSIX filesystem
# - archivefin:/tmp
# - backupfin:/tmp
restart: always
syncfin:
profiles: ["sda-finland"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-sync ]
container_name: syncfin
depends_on:
postgresfin:
condition: service_started
rabbitmqfin:
condition: service_healthy
s3fin:
condition: service_started
environment:
- BROKER_QUEUE=mapping_stream
volumes:
- ./configfin.yaml:/config.yaml
- keys:/keys
# uncomment if using POSIX filesystem
# - archivefin:/tmp
restart: always
sync-apifin:
profiles: ["sda-finland"]
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
command: [ sda-syncapi ]
container_name: sync-apifin
depends_on:
rabbitmqfin:
condition: service_healthy
environment:
- SYNC_API_INGESTROUTING=ingest
- SYNC_API_ACCESSIONROUTING=accession
- SYNC_API_MAPPINGROUTING=mappings
ports:
- "8090:8080"
restart: always
volumes:
- ./configfin.yaml:/config.yaml
mapperfin:
profiles: ["sda-finland"]
command: sda-mapper
container_name: mapperfin
depends_on:
postgresfin:
condition: service_started
rabbitmqfin:
condition: service_healthy
environment:
- BROKER_QUEUE=mappings
image: ghcr.io/neicnordic/sensitive-data-archive:${TAG}
volumes:
- ./configfin.yaml:/config.yaml
- keys:/keys
restart: always
bootstrapfin:
profiles: ["sda-finland"]
command: sh -c /bin/bootstrap.sh -p /keys/c4gh.pub
container_name: bsfin
image: neicnordic/sda-helm-tests-support:latest
user: 0:0
volumes:
- $PWD/scripts/bootstrap.sh:/bin/bootstrap.sh
- keys:/keys
volumes:
keys:
dbdata:
dbdatafin:
inboxfin:
archivefin:
backupfin:
shared: