-
Notifications
You must be signed in to change notification settings - Fork 41
/
docker-compose.yml
152 lines (143 loc) · 3.57 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
# docker compose versions
version: "2.3"
services:
# This dummy service provides shared configuration for all Node deps
node:
image: docker.io/library/node:20.12.2-bullseye
env_file: ./config.env
working_dir: /srv
command: bash -c 'yarn install && yarn pnpify tsc-watch -b --onSuccess "touch /watch/done"'
healthcheck:
test: test -f /watch/done || exit 1
interval: 5s
retries: 60
tmpfs:
- /watch
volumes:
- ./:/srv:rw,z
- /srv/dist
- /srv/.build-cache
# web app bundle build
app:
extends:
service: node
command: bash -c 'yarn workspace @openneuro/app start'
healthcheck:
test: curl -f http://localhost/index.html || 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 'sleep 10 && yarn workspace @openneuro/indexer start'
depends_on:
server:
condition: service_healthy
elasticsearch:
condition: service_healthy
node:
condition: service_healthy
app:
condition: service_healthy
# mongodb
mongo:
image: docker.io/library/mongo:5.0
volumes:
- ${PERSISTENT_DIR}/mongo:/data/db:z
# Redis
redis:
image: docker.io/library/redis:alpine
# datalad Python backend
datalad:
build:
context: services/datalad
volumes:
- ${PERSISTENT_DIR}/datalad:/datalad:z
- ./services/datalad/datalad_service:/srv/datalad_service
env_file: ./config.env
init: true
command:
[
"uvicorn",
"--host",
"0.0.0.0",
"--port",
"80",
"--reload",
"--factory",
"datalad_service.app:create_app",
"--workers",
"8",
"--timeout-keep-alive",
"30",
"--log-level",
"debug",
]
networks:
default:
aliases:
- datalad-0
- datalad-1
# nginx + app
web:
image: docker.io/library/nginx:1.16.1
volumes:
- ./nginx/nginx.dev.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "8110:8110"
- "9876:80"
depends_on:
server:
condition: service_healthy
datalad:
condition: service_healthy
app:
condition: service_healthy
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.4
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
xpack.security.enabled: false
xpack.security.enrollment.enabled: false
ES_JAVA_OPTS: "-Xms750m -Xmx750m"
healthcheck:
test: "curl -s -f http://localhost:9200 || exit 1"
interval: 10s
timeout: 5s
retries: 3
ports:
- "9200:9200"
- "9300:9300"