-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.ccm.yaml
164 lines (159 loc) · 6.21 KB
/
docker-compose.ccm.yaml
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
version: "3.9"
x-common: &common
restart: unless-stopped
logging:
driver: journald
x-app: &app
image: "ghcr.io/ccmbioinfo/stager:${ST_VERSION}"
user: www-data
command: --workers ${GUNICORN_WORKERS:-1}
tmpfs:
- /tmp
healthcheck:
test: ["CMD", "./healthcheck.py"]
<<: *common
x-env: &env
FORWARDED_ALLOW_IPS: "*" # equivalent to --forwarded-allow-ips, we are behind a reverse proxy
SQLALCHEMY_SIDECAR: /var/tmp/sqlalchemy.fifo
MINIO_REGION_NAME: hpc4health
MINIO_TLS: "true"
MSTEAMS_WEBHOOK_URL:
x-sidecar: &sidecar
image: busybox
init: true
user: www-data
command: tail -f -n +1 /var/log/stager/sqlalchemy.fifo
<<: *common
services:
app-hiraki:
<<: *app
environment:
<<: *env
ST_SECRET_KEY: "${HIRAKI_ST_SECRET_KEY}"
ST_DATABASE_URI: "mysql+pymysql://${HIRAKI_MYSQL_CONNECTION_STRING}"
MINIO_ENDPOINT: "${HIRAKI_MINIO_ENDPOINT}"
MINIO_ACCESS_KEY: "${HIRAKI_MINIO_ACCESS_KEY}"
MINIO_SECRET_KEY: "${HIRAKI_MINIO_SECRET_KEY}"
labels:
traefik.enable: true
# Routing for the main application server
traefik.http.routers.app-hiraki.rule: Host(`stager-hiraki.ccm.sickkids.ca`) # && PathPrefix(`/api`)
traefik.http.routers.app-hiraki.entrypoints: https
traefik.http.routers.app-hiraki.middlewares: app,security@file
traefik.http.routers.app-hiraki.service: app-hiraki
traefik.http.services.app-hiraki.loadbalancer.server.port: 5000
# Routing for the Prometheus metrics endpoint
traefik.http.routers.metrics-hiraki.rule: Host(`stager-hiraki.ccm.sickkids.ca`) # && PathPrefix(`/metrics`)
traefik.http.routers.metrics-hiraki.entrypoints: traefik
traefik.http.routers.metrics-hiraki.middlewares: security@file
traefik.http.routers.metrics-hiraki.service: metrics-hiraki
traefik.http.services.metrics-hiraki.loadbalancer.server.port: 8080
# Shared CORS middleware between services
traefik.http.middlewares.app.headers.accessControlAllowOriginList: https://stager.ccm.sickkids.ca
traefik.http.middlewares.app.headers.accessControlAllowMethods: GET,HEAD,POST,PUT,DELETE,OPTIONS,PATCH
traefik.http.middlewares.app.headers.accessControlAllowHeaders: Accept,Content-Type
traefik.http.middlewares.app.headers.accessControlAllowCredentials: true
volumes:
- log-hiraki:/var/tmp
sidecar-sqlalchemy-hiraki:
<<: *sidecar
volumes:
- log-hiraki:/var/log/stager:ro
depends_on:
- app-hiraki
app-muise:
<<: *app
environment:
<<: *env
ST_SECRET_KEY: "${MUISE_ST_SECRET_KEY}"
ST_DATABASE_URI: "mysql+pymysql://${MUISE_MYSQL_CONNECTION_STRING}"
MINIO_ENDPOINT: "${MUISE_MINIO_ENDPOINT}"
MINIO_ACCESS_KEY: "${MUISE_MINIO_ACCESS_KEY}"
MINIO_SECRET_KEY: "${MUISE_MINIO_SECRET_KEY}"
labels:
traefik.enable: true
# Routing for the main application server
traefik.http.routers.app-muise.rule: Host(`stager-muise.ccm.sickkids.ca`) # && PathPrefix(`/api`)
traefik.http.routers.app-muise.entrypoints: https
traefik.http.routers.app-muise.middlewares: app,security@file
traefik.http.routers.app-muise.service: app-muise
traefik.http.services.app-muise.loadbalancer.server.port: 5000
# Routing for the Prometheus metrics endpoint
traefik.http.routers.metrics-muise.rule: Host(`stager-muise.ccm.sickkids.ca`) # && PathPrefix(`/metrics`)
traefik.http.routers.metrics-muise.entrypoints: traefik
traefik.http.routers.metrics-muise.middlewares: security@file
traefik.http.routers.metrics-muise.service: metrics-muise
traefik.http.services.metrics-muise.loadbalancer.server.port: 8080
volumes:
- log-muise:/var/tmp
sidecar-sqlalchemy-muise:
<<: *sidecar
volumes:
- log-muise:/var/log/stager:ro
depends_on:
- app-muise
# app-hawkins:
# <<: *app
# environment:
# <<: *env
# ST_SECRET_KEY: "${HAWKINS_ST_SECRET_KEY}"
# ST_DATABASE_URI: "mysql+pymysql://${HAWKINS_MYSQL_CONNECTION_STRING}"
# MINIO_ENDPOINT: "${HAWKINS_MINIO_ENDPOINT}"
# MINIO_ACCESS_KEY: "${HAWKINS_MINIO_ACCESS_KEY}"
# MINIO_SECRET_KEY: "${HAWKINS_MINIO_SECRET_KEY}"
# labels:
# traefik.enable: true
# # Routing for the main application server
# traefik.http.routers.app-hawkins.rule: Host(`stager-hawkins.ccm.sickkids.ca`) # && PathPrefix(`/api`)
# traefik.http.routers.app-hawkins.entrypoints: https
# traefik.http.routers.app-hawkins.middlewares: app,security@file
# traefik.http.routers.app-hawkins.service: app-hawkins
# traefik.http.services.app-hawkins.loadbalancer.server.port: 5000
# # Routing for the Prometheus metrics endpoint
# traefik.http.routers.metrics-hawkins.rule: Host(`stager-hawkins.ccm.sickkids.ca`) # && PathPrefix(`/metrics`)
# traefik.http.routers.metrics-hawkins.entrypoints: traefik
# traefik.http.routers.metrics-hawkins.middlewares: security@file
# traefik.http.routers.metrics-hawkins.service: metrics-hawkins
# traefik.http.services.metrics-hawkins.loadbalancer.server.port: 8080
# volumes:
# - log-hawkins:/var/tmp
# sidecar-sqlalchemy-hawkins:
# <<: *sidecar
# volumes:
# - log-hawkins:/var/log/stager:ro
# depends_on:
# - app-hawkins
proxy:
image: traefik:2.6
environment:
TZ: America/Toronto
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- "${PROJECT_ROOT:-.}/traefik:/etc/traefik"
ports:
- "80:80"
- "443:443"
- "8443:8443" # Traefik and Prometheus endpoint
command:
- --api
- --providers.docker
- --providers.docker.exposedbydefault=false
- --providers.file.directory=/etc/traefik
- --providers.file.watch=false
- --accesslog
- --log
- --metrics.prometheus
- --metrics.prometheus.manualrouting
- --global.checknewversion=false
- --global.sendanonymoususage=false
- --entrypoints.http.address=:80
- --entrypoints.http.http.redirections.entrypoint.to=https
- --entrypoints.https.address=:443
- --entrypoints.https.http.tls
- --entrypoints.traefik.address=:8443
- --entrypoints.traefik.http.tls
<<: *common
volumes:
log-hiraki:
log-muise:
# log-hawkins: