forked from OpenNeuroOrg/openneuro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
194 lines (182 loc) · 4.59 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
# docker compose versions
version: '2.3'
volumes:
node_deps:
dist:
dist_app:
dist_client:
dist_cli:
dist_components:
dist_indexer:
dist_server:
typescript_build_cache:
node_modules_app:
node_modules_components:
services:
# This dummy service provides shared configuration for all Node deps
node:
image: node:14.16.1
env_file: ./config.env
working_dir: /srv
command: bash -c 'yarn install && yarn tsc-watch -b --onSuccess "touch /watch/done"'
healthcheck:
test: test -f /watch/done || exit 1
interval: 5s
retries: 60
tmpfs:
- /watch
volumes:
- ./:/srv:cached
- typescript_build_cache:/srv/.build-cache
- node_deps:/srv/.yarn
- ./.yarn/releases:/srv/.yarn/releases:cached
- ./.yarn/plugins:/srv/.yarn/plugins:cached
- dist:/srv/dist
- dist_app:/srv/packages/openneuro-app/dist
- dist_cli:/srv/packages/openneuro-cli/dist
- dist_client:/srv/packages/openneuro-client/dist
- dist_components:/srv/packages/openneuro-components/dist
- dist_indexer:/srv/packages/openneuro-indexer/dist
- dist_server:/srv/packages/openneuro-server/dist
- node_modules_app:/srv/packages/openneuro-app/node_modules
- node_modules_components:/srv/packages/openneuro-components/node_modules
# web app bundle build
app:
extends:
service: node
command: bash -c 'yarn workspace @openneuro/app start'
healthcheck:
test: curl -f http://localhost/robots.txt || exit 1
interval: 5s
retries: 10
ports:
# HMR port
- '9992:9992'
environment:
- NODE_ENV=development
depends_on:
node:
condition: service_healthy
# crn node server
server:
extends:
service: node
command: bash -c 'yarn workspace @openneuro/server start'
healthcheck:
test: curl -f http://localhost:8111/crn || exit 1
interval: 5s
retries: 10
depends_on:
redis:
condition: service_started
mongo:
condition: service_started
datalad:
condition: service_healthy
elasticsearch:
condition: service_started
node:
condition: service_healthy
# Elastic Search indexer
indexer:
extends:
service: node
command: bash -c 'yarn workspace @openneuro/indexer start'
depends_on:
server:
condition: service_healthy
elasticsearch:
condition: service_started
node:
condition: service_healthy
app:
condition: service_healthy
# mongodb
mongo:
image: mongo:4.4
volumes:
- ${PERSISTENT_DIR}/mongo:/data/db:delegated
# Redis
redis:
image: redis:alpine
# datalad Python backend
datalad:
build:
context: services/datalad
target: base
volumes:
- ${PERSISTENT_DIR}/datalad:/datalad:delegated
- ./services/datalad/datalad_service:/datalad_service:delegated
env_file: ./config.env
init: true
command:
[
'gunicorn',
'--bind',
'0.0.0.0:80',
'--reload',
"datalad_service.app:create_app('/datalad')",
'--workers',
'8',
'--worker-class',
'gevent',
'--timeout',
'60',
'--keep-alive',
'30',
'--log-level',
'debug',
]
networks:
default:
aliases:
- datalad-0
- datalad-1
# nginx + app
web:
image: nginx:1.16.1
volumes:
- ./nginx/nginx.dev.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- '80:80'
- '8110:8110'
- '9876:80'
depends_on:
server:
condition: service_healthy
datalad:
condition: service_healthy
app:
condition: service_healthy
storybook:
extends:
service: node
command: bash -c 'yarn workspace @openneuro/components storybook'
ports:
- '6006:6006'
environment:
- NODE_ENV=development
depends_on:
node:
condition: service_healthy
app:
condition: service_healthy
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.2
environment:
discovery.type: single-node
cluster.routing.allocation.disk.threshold_enabled: 'true'
cluster.routing.allocation.disk.watermark.flood_stage: 1gb
cluster.routing.allocation.disk.watermark.low: 10gb
cluster.routing.allocation.disk.watermark.high: 5gb
ports:
- '9200:9200'
- '9300:9300'
# comment out `x-disabled` to enable kibana service
x-disabled:
kibana:
image: kibana:7.10.1
depends_on:
- elasticsearch
ports:
- '5601:5601'