-
Notifications
You must be signed in to change notification settings - Fork 24
/
docker-compose.yml
306 lines (287 loc) · 8.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
version: "2.2"
services:
# Production
webknossos:
build:
context: .
dockerfile: Dockerfile
cache_from:
- scalableminds/webknossos
- scalableminds/webknossos:${DEV_CACHE:-master}
image: scalableminds/webknossos:${DOCKER_TAG:-master}
ports:
- "9000:9000"
links:
- "fossildb-persisted:fossildb"
- "postgres-persisted:postgres"
depends_on:
postgres-persisted:
condition: service_healthy
fossildb-persisted:
condition: service_healthy
redis:
condition: service_healthy
command:
- -Dconfig.file=conf/application.conf
- -Djava.net.preferIPv4Stack=true
- -Dtracingstore.fossildb.address=fossildb
- -Dtracingstore.redis.address=redis
- -Ddatastore.redis.address=redis
- -Dslick.db.url=jdbc:postgresql://postgres/webknossos
- -DwebKnossos.sampleOrganization.enabled=false
# the following lines need to be adapted for non-localhost deployments
# - -Dhttp.uri=http://example.org:9000
# - -Dtracingstore.publicUri=http://example.org:9000
# - -Ddatastore.publicUri=http://example.org:9000
# the following lines disable the integrated datastore:
# - -Dplay.modules.enabled-="com.scalableminds.webknossos.datastore.DataStoreModule"
# - -Dplay.http.router="noDS.Routes"
volumes:
- ./binaryData:/webknossos/binaryData
environment:
POSTGRES_URL: jdbc:postgresql://postgres/webknossos
POSTGRES_USER: webknossos_user
POSTGRES_PASSWORD: secret_password
user: ${USER_UID:-1000}:${USER_GID:-1000}
webknossos-datastore:
build: webknossos-datastore
image: scalableminds/webknossos-datastore:${DOCKER_TAG:-master}
ports:
- "9090:9090"
volumes:
- ./binaryData:/webknossos-datastore/binaryData
command:
- -J-Xmx20G
- -J-Xms1G
- -Dconfig.file=conf/standalone-datastore.conf
- -Dhttp.port=9090
- -Dhttp.uri=http://webknossos-datastore:9090
- -Ddatastore.webKnossos.uri=webknossos:9000
- -Ddatastore.redis.address=redis
depends_on:
redis:
condition: service_healthy
webknossos-tracingstore:
build: webknossos-tracingstore
image: scalableminds/webknossos-tracingstore:${DOCKER_TAG:-master}
ports:
- "9050:9050"
command:
- -J-Xmx20G
- -J-Xms1G
- -Dconfig.file=conf/standalone-tracingstore.conf
- -Dhttp.port=9050
- -Dhttp.uri=http://webknossos-datastore:9050
- -Dtracingstore.fossildb.address=fossildb
- -Dtracingstore.redis.address=redis
- -Ddatastore.webknossos.uri=webknossos:9000
links:
- "fossildb-persisted:fossildb"
depends_on:
redis:
condition: service_healthy
fossildb-persisted:
condition: service_healthy
# Development
base:
image: scalableminds/webknossos-dev
build:
context: .
dockerfile: Dockerfile.dev
cache_from:
- scalableminds/webknossos-dev
- scalableminds/webknossos-dev:${DEV_CACHE:-master}
environment:
- USER_NAME=${USER_NAME:-sbt-user}
- USER_UID
- USER_GID
- COVERALLS_REPO_TOKEN
- TZ=${TZ:-Europe/Berlin}
- POSTGRES_URL=jdbc:postgresql://postgres/webknossos
- POSTGRES_USER=webknossos_user
- POSTGRES_PASSWORD=secret_password
- HOME=/root
- CIRCLE_TAG=${CIRCLE_TAG}
- CIRCLE_BUILD_NUM=${CIRCLE_BUILD_NUM}
- NODE_OPTIONS=--max_old_space_size=2048
# This will be picked up by ava so that the tests fail if a snapshot doesn't exist during CI, see https://github.com/avajs/ava/issues/1585
- CI
working_dir: /home/${USER_NAME:-sbt-user}/webknossos
volumes:
- ".:/home/${USER_NAME:-sbt-user}/webknossos"
- "${DOCKER_CACHE_PREFIX:-~}/.ivy2:/tmp/.ivy2"
- "${DOCKER_CACHE_PREFIX:-~}/.cache/coursier:/root/.cache/coursier"
- "${DOCKER_CACHE_PREFIX:-~}/.cache/yarn:/root/.cache/yarn"
user: ${USER_UID:-1000}:${USER_GID:-1000}
compile:
extends:
service: base
depends_on:
postgres:
condition: service_healthy
dev:
extends:
service: base
ports:
- "5005:5005"
- "9000:9000"
links:
- "fossildb-dev:fossildb"
- "postgres-dev:postgres"
depends_on:
redis:
condition: service_healthy
postgres-dev:
condition: service_healthy
fossildb-dev:
condition: service_healthy
environment:
POSTGRES_URL: jdbc:postgresql://postgres/webknossos
POSTGRES_USER: webknossos_user
POSTGRES_PASSWORD: secret_password
command:
- bash
- -c
- >
sbt
-v -d -jvm-debug 5005
"run
-Djava.net.preferIPv4Stack=true
-Dtracingstore.fossildb.address=fossildb
-Dtracingstore.redis.address=redis"
-Ddatastore.redis.address=redis"
stdin_open: true
# Tests
backend-tests:
extends:
service: base
ports:
- "5005:5005"
- "9000:9000"
command: sbt -v "testOnly backend.*"
backend-lint-format:
extends:
service: base
ports:
- "5005:5005"
- "9000:9000"
command: sbt ";scapegoat; scalafmtCheck; util/scalafmtCheck; webknossosTracingstore/scalafmtCheck; webknossosDatastore/scalafmtCheck"
e2e-tests:
extends:
service: backend-tests
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
fossildb:
condition: service_healthy
environment:
POSTGRES_URL: jdbc:postgresql://postgres/webknossos_testing
POSTGRES_USER: webknossos_user
POSTGRES_PASSWORD: secret_password
command:
- bash
- -c
- >
sbt
-v
"testOnly e2e.* --
-Dtracingstore.fossildb.address=fossildb
-Dtracingstore.redis.address=redis
-Ddatastore.redis.address=redis
-Ddatastore.watchFileSystem.enabled=false"
volumes:
- ./binaryData/Connectomics department:/home/${USER_NAME:-sbt-user}/webknossos/binaryData/Organization_X
screenshot-tests:
image: scalableminds/puppeteer:master
environment:
- URL
- WK_AUTH_TOKEN
working_dir: /home/pptruser/webknossos
command: bash -c 'for i in {1..3}; do yarn test-screenshot && break; done'
volumes:
- ".:/home/pptruser/webknossos"
user: ${USER_UID:-1000}:${USER_GID:-1000}
# Postgres
postgres:
image: postgres:10-alpine
environment:
POSTGRES_DB: webknossos
POSTGRES_USER: webknossos_user
POSTGRES_PASSWORD: secret_password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -h 127.0.0.1 -p 5432"]
interval: 2s
timeout: 5s
retries: 30
postgres-persisted:
extends:
service: postgres
ports:
- "5434:5432"
volumes:
- "./pg/db:/var/lib/postgresql/data/"
postgres-dev:
extends:
service: postgres
ports:
- "127.0.0.1:5432:5432"
volumes:
- "./pg/dev-db:/var/lib/postgresql/data/"
psql:
extends: postgres
command: psql -h postgres -U webknossos_user webknossos
links:
- "postgres-persisted:postgres"
depends_on:
postgres-persisted:
condition: service_healthy
environment:
PGPASSWORD: secret_password
volumes:
- ./conf/evolutions/:/evolutions/
drop-db:
extends: postgres
command: psql -h postgres -U webknossos_user postgres -c "DROP DATABASE webknossos"
links:
- "postgres-persisted:postgres"
depends_on:
postgres-dev:
condition: service_healthy
environment:
PGPASSWORD: secret_password
# FossilDB
fossildb:
image: scalableminds/fossildb:master__484
command:
- fossildb
- -c
- skeletons,skeletonUpdates,volumes,volumeData,volumeUpdates,volumeSegmentIndex,editableMappings,editableMappingUpdates,editableMappingsInfo,editableMappingsAgglomerateToGraph,editableMappingsSegmentToAgglomerate
user: ${USER_UID:-fossildb}:${USER_GID:-fossildb}
fossildb-persisted:
extends:
service: fossildb
volumes:
- "./fossildb/data:/fossildb/data"
- "./fossildb/backup:/fossildb/backup"
fossildb-dev:
extends:
service: fossildb
volumes:
- "./fossildb-dev/data:/fossildb/data"
- "./fossildb-dev/backup:/fossildb/backup"
# Redis
redis:
image: redis:5.0
command:
- redis-server
healthcheck:
test:
- CMD
- bash
- -c
- "exec 3<> /dev/tcp/127.0.0.1/6379 && echo PING >&3 && head -1 <&3 | grep PONG"
timeout: 1s
interval: 5s
retries: 10