-
Notifications
You must be signed in to change notification settings - Fork 100
/
docker-compose_dev.yml
executable file
·335 lines (316 loc) · 8.95 KB
/
docker-compose_dev.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
# https://docs.docker.com/compose/yml/
# Each service defined in docker-compose.yml must specify exactly one of
# image or build. Other keys are optional, and are analogous to their
# docker run command-line counterparts.
#
# As with docker run, options specified in the Dockerfile (e.g., CMD,
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to
# specify them again in docker-compose.yml.
#
# Fedora (and RHEL, CentOS) use SELinux.
# Docker needs :z volume mount options to provide a context label.
# See man docker-run
#version: '3.9'
services:
chrisomatic:
image: ghcr.io/fnndsc/chrisomatic:0.8.2
volumes:
- "./chrisomatic:/etc/chrisomatic:ro"
- "/var/run/docker.sock:/var/run/docker.sock:rw"
working_dir: /etc/chrisomatic
userns_mode: host
networks:
- local
depends_on:
- chris_dev
- chris_store
profiles:
- tools
db_migrate:
image: ${CHRISREPO}/chris:dev
build:
context: .
args:
ENVIRONMENT: local
volumes:
- ./chris_backend:/opt/app-root/src:z
environment:
- DJANGO_SETTINGS_MODULE=config.settings.local
command: python manage.py migrate --noinput
user: ${UID}:${GID}
depends_on:
chris_dev_db:
condition: service_healthy
networks:
local:
chris_dev:
image: ${CHRISREPO}/chris:dev
build:
context: .
args:
ENVIRONMENT: local
stdin_open: true # docker run -i
tty: true # docker run -t
volumes:
- ./chris_backend:/opt/app-root/src:z
user: ${UID}:${GID}
environment:
- DJANGO_SETTINGS_MODULE=config.settings.local
command: python manage.py runserver 0.0.0.0:8000
ports:
- "8000:8000"
depends_on:
db_migrate:
condition: service_completed_successfully
swift_service:
condition: service_started
queue:
condition: service_started
chris_store:
condition: service_started
networks:
local:
aliases:
- chrisdev.local
remote: # bc special automated tests worker runs within CUBE, not needed in prod
minikube:
extra_hosts:
- "${PFCONDNS:-lhost}:${PFCONIP:-127.0.0.1}" # used only for kubernetes, not needed in prod
labels:
name: "ChRIS_ultron_backEnd"
role: "Backend development server"
org.chrisproject.role: "ChRIS_ultron_backEnd"
worker:
image: ${CHRISREPO}/chris:dev
build:
context: .
args:
ENVIRONMENT: local
volumes:
- ./chris_backend:/opt/app-root/src:z
user: ${UID}:${GID}
environment:
- DJANGO_SETTINGS_MODULE=config.settings.local
- CELERY_RDB_HOST=0.0.0.0
- CELERY_RDB_PORT=6900
command: celery -A core worker -c 3 -l DEBUG -Q main1,main2
ports:
- "6900-6905:6900-6905"
depends_on:
db_migrate:
condition: service_completed_successfully
swift_service:
condition: service_started
queue:
condition: service_started
# service also depends on pfcon service defined in swarm/docker-compose_remote.yml
networks:
- local
- remote
# When the remote ancillary service pfcon is deployed using kubernetes it can not
# use (connect to) an external docker overlay network: remote. In that case we
# instead use extra_hosts to let the worker know pfcon's IP address. The required
# shell variables referenced here must then be set like this: PFCONDNS=pfcon.remote,
# PFCONIP=<actual IP address of localhost> and REMOTENETWORK=false
# if you are using minikube to run the kubernetes cluster, Set the environment variable in make.sh
# MINIKUBENETWORK to true and the HOSTIP will be minikube's ip, to get this, you can run the
# command 'minikube ip' on the terminal
extra_hosts:
- "${PFCONDNS:-lhost}:${PFCONIP:-127.0.0.1}"
labels:
name: "ChRIS_ultron_backEnd Asynchronous Tasks Worker"
role: "Backend development async task worker"
worker_periodic:
image: ${CHRISREPO}/chris:dev
build:
context: .
args:
ENVIRONMENT: local
volumes:
- ./chris_backend:/opt/app-root/src:z
user: ${UID}:${GID}
environment:
- DJANGO_SETTINGS_MODULE=config.settings.local
command: celery -A core worker -c 1 -l DEBUG -Q periodic
depends_on:
db_migrate:
condition: service_completed_successfully
swift_service:
condition: service_started
queue:
condition: service_started
networks:
- local
labels:
name: "ChRIS_ultron_backEnd Periodic Task Worker"
role: "Backend development periodic task worker"
scheduler:
image: ${CHRISREPO}/chris:dev
build:
context: .
args:
ENVIRONMENT: local
volumes:
- ./chris_backend:/opt/app-root/src:z
user: ${UID}:${GID}
environment:
- DJANGO_SETTINGS_MODULE=config.settings.local
command: celery -A core beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
depends_on:
db_migrate:
condition: service_completed_successfully
swift_service:
condition: service_started
queue:
condition: service_started
# restart until Django DB migrations are ready
deploy:
restart_policy:
condition: on-failure
networks:
- local
labels:
name: "ChRIS_ultron_backEnd Periodic Tasks Scheduler"
role: "Backend development periodic tasks scheduler"
chris_dev_db:
image: postgres:16
volumes:
- chris_dev_db_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=chris_dev
- POSTGRES_USER=chris
- POSTGRES_PASSWORD=Chris1234
networks:
- local
labels:
name: "ChRIS_ultron_backEnd PostgreSQL Database"
role: "Backend development database"
healthcheck:
test: ["CMD", "pg_isready"]
interval: 2s
timeout: 4s
retries: 3
start_period: 60s
queue:
image: rabbitmq:3
hostname: 'queue'
volumes:
- queue_data:/var/lib/rabbitmq
networks:
- local
labels:
name: "ChRIS_ultron_backEnd Asynchronous Task Queue"
role: "Backend development async task queue"
chris_store:
image: ${STOREREPO}/chris_store
environment:
- DJANGO_SETTINGS_MODULE=config.settings.production
- DJANGO_DB_MIGRATE=on
- DJANGO_ALLOWED_HOSTS=*
- DJANGO_SECRET_KEY="w1kxu^l=@pnsf!5piqz6!!5kdcdpo79y6jebbp+2244yjm*#+k"
- DJANGO_CORS_ALLOW_ALL_ORIGINS=true
- DJANGO_CORS_ALLOWED_ORIGINS=https://babymri.org
- DJANGO_SECURE_PROXY_SSL_HEADER=
- DJANGO_USE_X_FORWARDED_HOST=false
- DATABASE_HOST=chris_store_db
- DATABASE_PORT=5432
- SWIFT_AUTH_URL=http://swift_service:8080/auth/v1.0
- POSTGRES_DB=chris_store
- POSTGRES_USER=chris
- POSTGRES_PASSWORD=Chris1234
- SWIFT_USERNAME=chris:chris1234
- SWIFT_KEY=testing
- SWIFT_CONTAINER_NAME=store_users
ports:
- "8010:8010"
depends_on:
- chris_store_db
- swift_service
networks:
local:
aliases:
- chris-store.local
labels:
name: "ChRIS_store"
role: "Chris store service"
chris_store_db:
image: postgres:16
volumes:
- chris_store_db_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=chris_store
- POSTGRES_USER=chris
- POSTGRES_PASSWORD=Chris1234
networks:
- local
labels:
name: "ChRIS_store PostgreSQL Database"
role: "Chris store database"
swift_service:
image: ${SWIFTREPO}/docker-swift-onlyone
init: true
volumes:
- swift_storage_dev:/srv
environment:
- SWIFT_USERNAME=chris:chris1234
- SWIFT_KEY=testing
ports:
- "8080:8080"
networks:
- local
- remote # only needed for pfcon operating in-network
labels:
name: "Swift"
role: "Swift object storage service"
lldap:
image: nitnelave/lldap:stable
ports:
- "3890:3890"
- "17170:17170"
volumes:
- "lldap_data:/data"
environment:
- UID=10100
- GID=10100
- TZ=America/New_York
- LLDAP_JWT_SECRET=super_secret_random_string
- LLDAP_LDAP_USER_PASS=chris1234
- LLDAP_LDAP_BASE_DN=dc=example,dc=org
networks:
local:
orthanc:
image: docker.io/jodogne/orthanc-plugins:1.12.3
volumes:
- ./orthanc.json:/etc/orthanc/orthanc.json:ro
- orthanc:/var/lib/orthanc/db
ports:
- "4242:4242"
- "8042:8042"
networks:
local:
pfdcm:
image: ghcr.io/fnndsc/pfdcm:3.1.2
container_name: pfdcm
environment:
MAX_WORKERS: 1
volumes:
- ./dicom:/home/dicom:rw
- ./pfdcm-services:/home/dicom/services:ro
- ${STOREBASE:?}:/chris_files:rw
ports:
- "4005:4005"
networks:
local:
networks:
local:
remote:
external: ${REMOTENETWORK:-true}
minikube:
external: ${MINIKUBENETWORK:-false}
volumes:
chris_dev_db_data:
chris_store_db_data:
queue_data:
swift_storage_dev:
lldap_data:
orthanc: