-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.prod.yml
98 lines (97 loc) · 2.79 KB
/
compose.prod.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
services:
webproxy:
image: "ghcr.io/cam-digital-hospitals/monorepo-webproxy:${TAG:-latest}"
depends_on:
- docs
- frontend
- mongo-express
- des-api
ports:
- "80:80"
# FastAPI -- DES service
des-api:
image: "ghcr.io/cam-digital-hospitals/monorepo-des-api:${TAG:-latest}"
environment:
FASTAPI_ROOT: "/api/des"
MONGO_URL: mongo
MONGO_PORT: 27017
MONGO_PASSWORD_FILE: /run/secrets/mongo-root-pw
REDIS_URL: redis
REDIS_PORT: 6379
secrets:
- mongo-root-pw
stop_grace_period: 3s
# Internal documentation website
docs:
image: "ghcr.io/cam-digital-hospitals/monorepo-docs:${TAG:-latest}"
# Public frontend (Dashboard)
frontend:
image: ghcr.io/cam-digital-hospitals/monorepo-frontend
environment:
DASH_BASE_PATHNAME: "/frontend/"
TIMEOUT: 120
WORKERS: 4
ASSETS_DIRNAME: "/app/assets"
DES_FASTAPI_URL: "http://webproxy/api/des"
stop_grace_period: 3s
# A worker for handling long-running BIM module tasks. Runs tasks sequentially from a queue.
des-worker:
scale: 8
image: "ghcr.io/cam-digital-hospitals/monorepo-des-worker:${TAG:-latest}"
depends_on:
- redis
environment:
MONGO_URL: mongo
MONGO_PORT: 27017
MONGO_USER: root
MONGO_PASSWORD_FILE: /run/secrets/mongo-root-pw
REDIS_URL: redis
REDIS_PORT: 6379
secrets:
- mongo-root-pw
stop_grace_period: 3s
# MongoDB database
mongo:
image: mongo:7.0-jammy
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongo-root-pw
volumes:
- dev-mongo:/data/db
healthcheck:
test: ["CMD-SHELL", "mongosh --eval 'db.runCommand(\"ping\").ok' --quiet"]
interval: 10s
timeout: 3s
retries: 5
secrets:
- mongo-root-pw
# Admin portal for the local database.
mongo-express:
image: mongo-express:1.0-18-alpine3.18 # mongo version, node version, linux version
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_SITE_BASEURL: /mongoadmin
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD_FILE: /run/secrets/mongo-root-pw
ME_CONFIG_MONGODB_ENABLE_ADMIN : true
ME_CONFIG_BASICAUTH_USERNAME: user
ME_CONFIG_BASICAUTH_PASSWORD_FILE: /run/secrets/mongo-pw
secrets:
- mongo-root-pw
- mongo-pw
# A separate database for managing worker tasks -- used by the 'rq' Python package.
redis:
image: redis:7.2
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 10s
timeout: 3s
retries: 5
volumes:
dev-mongo:
secrets:
mongo-root-pw:
file: ./secrets/mongo-root-pw.txt
mongo-pw:
file: ./secrets/mongo-pw.txt