Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (98 loc) · 4.06 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (98 loc) · 4.06 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
services:
nginx:
image: nginx:1.29.4-alpine
network_mode: host
environment:
- DEV_HOST=${DEV_HOST}
- NGINX_PORT=${NGINX_PORT}
- DEV_API_PORT=${DEV_API_PORT}
- DEV_UI_PORT=${DEV_UI_PORT}
- SD_PORT=${SD_PORT}
volumes:
- ./dev/resources/nginx.conf.template:/etc/nginx/templates/default.conf.template:ro
simple-directory:
# master (>= 8.24): the scoped NHI token exchange and the prefixed test API (POST /api/test-env/seed,
# DELETE /api/test-env?prefix=) the tests seed their accounts with —
# `docker compose pull simple-directory` if older
image: ghcr.io/data-fair/simple-directory:master
network_mode: host
depends_on:
mongo:
condition: service_healthy
environment:
- PORT=${SD_PORT}
- PUBLIC_URL=http://${DEV_HOST}:${NGINX_PORT}/simple-directory
- MONGO_URL=mongodb://localhost:${MONGO_PORT}/simple-directory
- OBSERVER_ACTIVE=false
- CIPHER_PASSWORD=dev-cipher-password-0123456789abcdef
# accounts in mongo: the test suite seeds and cleans its own sub-space (test_events_,
# tests/support/sd-fixtures.ts) through the test API; dev accounts can be seeded the same way
# under another prefix
- STORAGE_TYPE=mongo
- ENABLE_TEST_API=1
# the test API needs NODE_ENV=development, the configuration stays the image's production one
- NODE_ENV=development
- NODE_CONFIG_ENV=production
- ADMINS=["test_events_superadmin@test.com"]
- CONTACT=contact@test.com
# in dev simple-directory only notifies this service, directly (the shared identities router refuses calls through the proxy)
- IDENTITIES_WEBHOOKS=[{"base":"http://localhost:${DEV_API_PORT}/api/identities","key":"secret-identities"}]
# tests log in through the API many times per minute
- AUTHRATELIMIT_ATTEMPTS=200
- AUTHRATELIMIT_DURATION=1
- MANAGE_DEPARTMENTS=true
- MANAGE_PARTNERS=true
- MANAGE_SITES=true
- SECRET_SITES=secret-sites
- SECRET_EVENTS=secret-events
- SECRET_SENDMAILS=secret-sendmails
# notification mails of this service go to maildev (optional: npm run dev -- --profile maildev)
- MAILDEV_ACTIVE=true
- MAILDEV_URL=http://localhost:${MAILDEV_UI_PORT}
# host network: sd's default SMTP localhost:1025 would reach another env's maildev
- MAILS_TRANSPORT={"host":"localhost","port":${MAILDEV_SMTP_PORT},"ignoreTLS":true}
# per recipient, stored in mongo: repeated test runs would stop the mails silently
- MAILSRATELIMIT_POINTS=100000
- ROLES_DEFAULTS=["admin","contrib","user"]
# non-human identities (the scope tests, tests/support/sd-fixtures.ts)
- MANAGE_NHIS=true
# dev only: the test NHI issuer is not a real https issuer
- NHIS_ALLOW_INSECURE_ISSUERS=true
# every theme offered, so that the embeds can be checked in each of them (/events/dev/integrations)
- THEME_DARK=true
- THEME_HC=true
- THEME_HC_DARK=true
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "${SD_PORT}"]
interval: 2s
timeout: 2s
retries: 60
maildev:
profiles:
- maildev
image: maildev/maildev:2.1.0
ports:
- ${MAILDEV_UI_PORT}:1080
- ${MAILDEV_SMTP_PORT}:1025
# https://github.com/maildev/maildev/issues/484
healthcheck:
test: 'wget -O - http://127.0.0.1:$${MAILDEV_WEB_PORT}$${MAILDEV_BASE_PATHNAME}/healthz || exit 1'
mongo:
# production version; later 8.0 patches refuse Ubuntu 7.0 kernels (https://jira.mongodb.org/browse/SERVER-136848)
image: mongo:8.0.17
ports:
- ${MONGO_PORT}:27017
# wiredTiger takes half the machine's RAM by default
command: ["--wiredTigerCacheSizeGB", "0.25"]
volumes:
- mongo-data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 }).ok"]
# 2 s probes while starting, then one per minute: a mongosh probe costs ~1.3 s of CPU
interval: 60s
timeout: 10s
retries: 3
start_period: 3m
start_interval: 2s
volumes:
mongo-data: