forked from CenterForOpenScience/osf.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
573 lines (530 loc) · 15.5 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
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# Reference README-docker-compose.md for instructions.
volumes:
redis_data_vol:
external: false
postgres_data_vol:
external: false
gv_requirements_vol:
external: false
mongo_data_vol:
external: false
elasticsearch_data_vol:
external: false
elasticsearch6_data_vol:
external: false
rabbitmq_vol:
external: false
ember_osf_web_dist_vol:
external: false
preprints_dist_vol:
external: false
reviews_dist_vol:
external: false
mfr_requirements_vol:
external: false
mfr_requirements_local_bin_vol:
external: false
wb_requirements_vol:
external: false
wb_requirements_local_bin_vol:
external: false
wb_tmp_vol:
external: false
osfstoragecache_vol:
external: false
osf_requirements_3_12_vol:
external: false
osf_node_modules_vol:
external: false
osf_bower_components_vol:
external: false
osf_admin_node_modules_vol:
external: false
osf_admin_bower_components_vol:
external: false
services:
###################
# Shared Services #
###################
redis:
image: redis:7.0.9
restart: unless-stopped
ports:
- 6379:6379
volumes:
- redis_data_vol:/data
elasticsearch:
platform: linux/amd64
image: elasticsearch:2
ports:
- 9200:9200
volumes:
- elasticsearch_data_vol:/usr/share/elasticsearch/data
stdin_open: true
# Temporary: Remove when we've upgraded to ES6
elasticsearch6:
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.1
ports:
- 9201:9200
volumes:
- elasticsearch6_data_vol:/usr/share/elasticsearch/data
stdin_open: true
postgres:
image: postgres:15.4
command:
- /bin/bash
- -c
- echo "$$POSTGRES_INITDB_SQL" > /docker-entrypoint-initdb.d/commands.sql &&
docker-entrypoint.sh postgres
ports:
- 5432:5432
environment:
POSTGRES_INITDB_SQL: |
SELECT 'CREATE DATABASE gravyvalet' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'gravyvalet')\gexec
volumes:
- "${POSTGRES_DATA_VOL:-postgres_data_vol}:/var/lib/postgresql/data/"
stdin_open: true
mongo:
image: mongo:3.4
command:
- /bin/bash
- -c
- openssl req -newkey rsa:2048 -new -x509 -days 9999 -nodes
-subj "/C=US/ST=Virginia/L=Charlottesville/O=COS/OU=Test/CN=192.168.168.167"
-out /etc/ssl/mongodb.crt -keyout /etc/ssl/mongodb.key &&
cat /etc/ssl/mongodb.key /etc/ssl/mongodb.crt > /etc/ssl/mongodb.pem &&
chown -R mongodb:mongodb /etc/ssl /data/db &&
chmod -R 0600 /etc/ssl/* &&
gosu mongodb mongod --sslMode requireSSL --sslDisabledProtocols=TLS1_0,TLS1_1 --sslPEMKeyFile /etc/ssl/mongodb.pem
ports:
- 27017:27017
volumes:
- mongo_data_vol:/data/db
stdin_open: true
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
- 15672:15672
volumes:
- rabbitmq_vol:/var/lib/rabbitmq
stdin_open: true
# flower:
# image: quay.io/centerforopenscience/osf:develop
# command: python manage.py celery flower
# depends_on:
# - rabbitmq
# ports:
# - 5555:5555
# environment:
# BROKER_URL: amqp://guest:guest@rabbitmq:5672/
#########################
# Modular File Renderer #
#########################
mfr_requirements:
image: quay.io/centerforopenscience/mfr:develop
command:
- /bin/bash
- -c
- invoke install --develop &&
(python -m compileall /usr/local/lib/python3.5 || true) &&
rm -Rf /python3.5/* &&
cp -Rf -p /usr/local/lib/python3.5 /
restart: 'no'
volumes:
- mfr_requirements_vol:/python3.5
- mfr_requirements_local_bin_vol:/usr/local/bin
mfr:
image: quay.io/centerforopenscience/mfr:develop
command: invoke server
restart: unless-stopped
ports:
- 7778:7778
env_file:
- .docker-compose.mfr.env
volumes:
- mfr_requirements_vol:/usr/local/lib/python3.5
- mfr_requirements_local_bin_vol:/usr/local/bin
- wb_tmp_vol:/tmp
stdin_open: true
unoconv:
image: centerforopenscience/unoconv
environment:
UNO_PATH: /usr/lib/libreoffice
command:
- /bin/bash
- -c
- /usr/bin/python3.7 /usr/local/bin/unoconv --listener --server=0.0.0.0 --port=2002 -vvv &&
chmod -R 777 /tmp/mfrlocalcache
restart: unless-stopped
ports:
- 2002:2002
volumes:
- wb_tmp_vol:/tmp
stdin_open: true
###############
# WaterButler #
###############
wb_requirements:
image: quay.io/centerforopenscience/wb:develop
command:
- /bin/bash
- -c
- invoke install --develop &&
(python -m compileall /usr/local/lib/python3.6 || true) &&
rm -Rf /python3.6/* &&
cp -Rf -p /usr/local/lib/python3.6 /
restart: 'no'
volumes:
- wb_requirements_vol:/python3.6
- wb_requirements_local_bin_vol:/usr/local/bin
wb:
image: quay.io/centerforopenscience/wb:develop
command: invoke server
restart: unless-stopped
ports:
- 7777:7777
env_file:
- .docker-compose.wb.env
volumes:
- wb_requirements_vol:/usr/local/lib/python3.6
- wb_requirements_local_bin_vol:/usr/local/bin
- osfstoragecache_vol:/code/website/osfstoragecache
- wb_tmp_vol:/tmp
stdin_open: true
wb_worker:
image: quay.io/centerforopenscience/wb:develop
command: invoke celery
restart: unless-stopped
depends_on:
- wb
- rabbitmq
environment:
C_FORCE_ROOT: 1
env_file:
- .docker-compose.wb.env
volumes:
- wb_requirements_vol:/usr/local/lib/python3.6
- osfstoragecache_vol:/code/website/osfstoragecache
- wb_tmp_vol:/tmp
stdin_open: true
# wb_flower:
# image: quay.io/centerforopenscience/wb:develop
# # Install flower here, instead of in WB repo, due to tornado version conflict
# command: [/bin/bash, -c, "pip install flower && celery flower -A waterbutler.tasks.app.app --port=5556 --broker=amqp://guest:guest@192.168.168.167:5672//"]
# depends_on:
# - rabbitmq
# # Use non-default port to avoid conflict with OSF flower
# ports:
# - 5556:5556
##################################
# Central Authentication Service #
##################################
fakecas:
image: quay.io/centerforopenscience/fakecas:master
command: fakecas -host=0.0.0.0:8080 -osfhost=localhost:5000 -dbaddress=postgres://postgres@postgres:5432/osf?sslmode=disable
restart: unless-stopped
ports:
- 8080:8080
depends_on:
- postgres
stdin_open: true
#################
# Ember OSF Web #
#################
ember_osf_web:
image: quay.io/centerforopenscience/osf-web:develop-local
command: yarn run start --path dist --host 0.0.0.0 --port 4200 --live-reload-port 41953
restart: unless-stopped
depends_on:
- api
- web
environment:
# Uncomment below to enable collections on ember
# - COLLECTIONS_ENABLED=true
- BACKEND=local
- SHARE_BASE_URL=http://localhost:8003/
- SHARE_API_URL=http://localhost:8003/api/v2
- SHARE_SEARCH_URL=http://localhost:8003/api/v2/search/creativeworks/_search
expose:
- 4200
- 41953
ports:
- 4200:4200
- 41953:41953
volumes:
- ember_osf_web_dist_vol:/code/dist
stdin_open: true
#############
# Preprints #
#############
preprints:
image: quay.io/centerforopenscience/osf-preprints:develop-local
command:
- /bin/bash
- -c
- yarn --frozen-lockfile &&
./node_modules/.bin/bower install --allow-root --config.interactive=false &&
yarn start --host 0.0.0.0 --port 4201 --live-reload-port 41954
restart: unless-stopped
depends_on:
- api
- web
environment:
- BACKEND=env
- OSF_URL=http://localhost:5000/
- OSF_API_URL=http://localhost:8000
- OSF_MFR_URL=http://localhost:7778/
- OSF_RENDER_URL=http://localhost:7778/render
- OSF_FILE_URL=http://localhost:7777/
- OSF_HELP_URL=http://localhost:5000/help
- OSF_COOKIE_LOGIN_URL=http://localhost:8080/login
- OSF_OAUTH_URL=http://localhost:8080/oauth2/profile
- SHARE_BASE_URL=http://localhost:8003/
- SHARE_API_URL=http://localhost:8003/api/v2/
- SHARE_SEARCH_URL=http://localhost:8003/api/v2/search/creativeworks/_search
expose:
- 4201
- 41954
ports:
- 4201:4201
- 41954:41954
volumes:
- preprints_dist_vol:/code/dist
stdin_open: true
###########
# Reviews #
###########
reviews:
image: quay.io/centerforopenscience/osf-reviews:develop-local
command:
- /bin/bash
- -c
- yarn --frozen-lockfile &&
yarn start --host 0.0.0.0 --port 4203 --live-reload-port 41956
restart: unless-stopped
depends_on:
- api
- web
environment:
- BACKEND=local
expose:
- 4203
- 41956
ports:
- 4203:4203
- 41956:41956
volumes:
- reviews_dist_vol:/code/dist
stdin_open: true
#######
# OSF #
#######
requirements:
image: quay.io/centerforopenscience/osf:develop
# Need to allocate tty to be able to call invoke for requirements task
tty: true
command:
- /bin/bash
- -c
- python -m venv /tmp/venv
&& /tmp/venv/bin/pip install poetry==1.8.3 &&
/tmp/venv/bin/poetry install --no-root --without release --compile --sync &&
rm -rf /python3.12/* &&
cp -Rf -p /usr/local/lib/python3.12 /
restart: 'no'
environment:
DJANGO_SETTINGS_MODULE: api.base.settings
volumes:
- ./pyproject.toml:/code/pyproject.toml
- ./poetry.lock:/code/poetry.lock
- osf_requirements_3_12_vol:/python3.12
assets:
image: quay.io/centerforopenscience/osf:develop
command: python3 -m invoke assets -dw
restart: unless-stopped
environment:
DJANGO_SETTINGS_MODULE: api.base.settings
LANG: en_US.UTF-8
volumes:
- ./:/code:cached
- osf_requirements_3_12_vol:/usr/local/lib/python3.12
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_node_modules_vol:/code/node_modules
stdin_open: true
admin_assets:
image: quay.io/centerforopenscience/osf:develop
command: python3 -m invoke admin.assets -dw
restart: unless-stopped
environment:
DJANGO_SETTINGS_MODULE: admin.base.settings
LANG: en_US.UTF-8
volumes:
- ./:/code:cached
- osf_requirements_3_12_vol:/usr/local/lib/python3.12
- osf_node_modules_vol:/code/node_modules # needed due to admin references of ../webpack.<...>.js configurations.
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_admin_bower_components_vol:/code/admin/static/vendor/bower_components
- osf_admin_node_modules_vol:/code/admin/node_modules
stdin_open: true
sharejs:
image: quay.io/centerforopenscience/sharejs:develop
restart: unless-stopped
ports:
- 7007:7007
depends_on:
- mongo
- web
env_file:
- .docker-compose.sharejs.env
stdin_open: true
# beat:
# image: quay.io/centerforopenscience/osf:develop
# command: invoke celery_beat
# depends_on:
# - postgres
# - rabbitmq
# environment:
# C_FORCE_ROOT: 1
# DJANGO_SETTINGS_MODULE: api.base.settings
# env_file:
# - .docker-compose.env
# volumes:
# - ./:/code
# - osf_requirements_3_12_vol:/usr/local/lib/python3.12
# - osf_bower_components_vol:/code/website/static/vendor/bower_components
# - osf_node_modules_vol:/code/node_modules
worker:
image: quay.io/centerforopenscience/osf:develop
command: python3 -m invoke celery-worker
restart: unless-stopped
depends_on:
- postgres
- rabbitmq
- elasticsearch
environment:
C_FORCE_ROOT: 1
DJANGO_SETTINGS_MODULE: api.base.settings
# BROKER_URL: amqp://guest:guest@192.168.168.167:5671/
env_file:
- .docker-compose.env
volumes:
- ./:/code:cached
- osf_requirements_3_12_vol:/usr/local/lib/python3.12/
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_node_modules_vol:/code/node_modules
# - ./ssl/ca-chain.cert.pem:/etc/ssl/certs/ca-chain.cert.pem:ro
# - ./ssl/celery-client.cert.pem:/etc/ssl/certs/worker.pem:ro
# - ./ssl/celery-client.key.pem:/etc/ssl/private/worker.key:ro
stdin_open: true
admin:
image: quay.io/centerforopenscience/osf:develop
command: python3 -m invoke adminserver -h 0.0.0.0
restart: unless-stopped
environment:
DJANGO_SETTINGS_MODULE: admin.base.settings
ports:
- 8001:8001
depends_on:
- postgres
- rabbitmq
- elasticsearch
env_file:
- .docker-compose.env
stdin_open: true
volumes:
- ./:/code:cached
- osf_requirements_3_12_vol:/usr/local/lib/python3.12/
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_node_modules_vol:/code/node_modules
- osf_admin_bower_components_vol:/code/admin/static/vendor/bower_components
- osf_admin_node_modules_vol:/code/admin/node_modules
api:
image: quay.io/centerforopenscience/osf:develop
command: python3 -m invoke apiserver -h 0.0.0.0
restart: unless-stopped
ports:
- 8000:8000
depends_on:
- postgres
- rabbitmq
- elasticsearch
- redis
environment:
DJANGO_SETTINGS_MODULE: api.base.settings
env_file:
- .docker-compose.env
volumes:
- ./:/code:cached
- osf_requirements_3_12_vol:/usr/local/lib/python3.12/
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_node_modules_vol:/code/node_modules
stdin_open: true
web:
image: quay.io/centerforopenscience/osf:develop
command: python3 -m invoke server -h 0.0.0.0
restart: unless-stopped
ports:
- 5000:5000
depends_on:
- postgres
- rabbitmq
- elasticsearch
- redis
environment:
DJANGO_SETTINGS_MODULE: api.base.settings
env_file:
- .docker-compose.env
- .docker-compose.sharejs.env
volumes:
- ./:/code:cached
- osf_requirements_3_12_vol:/usr/local/lib/python3.12/
- osf_bower_components_vol:/code/website/static/vendor/bower_components
- osf_node_modules_vol:/code/node_modules
- ember_osf_web_dist_vol:/ember_osf_web
- preprints_dist_vol:/preprints
- reviews_dist_vol:/reviews
stdin_open: true
######
# GV #
######
gv_requirements:
image: quay.io/centerforopenscience/gravyvalet:develop
command:
- /bin/bash
- -c
- pip install -r requirements/dev-requirements.txt &&
(python3 -m compileall /usr/local/lib/python3.12 || true) &&
rm -Rf /python3.12/* &&
cp -Rf -p /usr/local/lib/python3.12 /
restart: 'no'
volumes:
- gv_requirements_vol:/python3.12
gv:
image: quay.io/centerforopenscience/gravyvalet:develop
command: python manage.py runserver 0.0.0.0:8004
restart: unless-stopped
ports:
- 8004:8004
depends_on:
- postgres
- api
env_file:
- .docker-compose.gv.env
environment:
DJANGO_SETTINGS_MODULE: app.settings
volumes:
- gv_requirements_vol:/usr/local/lib/python3.12
stdin_open: true
pigeon:
image: quay.io/centerforopenscience/osf-pigeon
restart: unless-stopped
environment:
- .osf-pigeon.env
ports:
- 2020:2020
env_file:
- .osf-pigeon.env
stdin_open: true
volumes:
- /srv