-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
347 lines (323 loc) · 8.96 KB
/
docker-compose.yaml
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
version: '3.4'
services:
minio:
image: minio/minio:RELEASE.2023-01-02T09-40-09Z
ports:
- 9100:9000
- 9101:9001
volumes:
- minio_storage:/data
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: miniotest
command: server --console-address ":9001" /data
healthcheck:
test: curl http://minio:9000/minio/health/live
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
createbucket:
image: minio/mc:RELEASE.2022-12-24T15-21-38Z
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 minio miniotest;
/usr/bin/mc mb myminio/epp;
/usr/bin/mc mb myminio/biorxiv;
exit 0;
"
temporal-db:
image: percona/percona-server:8.0.34-26.1-multi
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: testmysql
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
start_period: 2s
interval: 5s
timeout: 5s
retries: 10
temporal:
image: temporalio/auto-setup:1.26.2
ports:
- 7233:7233
environment:
DB: mysql8
MYSQL_SEEDS: temporal-db
MYSQL_USER: root
MYSQL_PWD: testmysql
DBNAME: temporal
VISIBILITY_DBNAME: "temporalvisibility"
DEFAULT_NAMESPACE: default
DEFAULT_NAMESPACE_RETENTION: 72h
SKIP_ADD_CUSTOM_SEARCH_ATTRIBUTES: true
TEMPORAL_ADDRESS: temporal:7233
healthcheck:
test: temporal operator namespace list
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
depends_on:
temporal-db:
condition: service_healthy
volumes:
- temporal_data:/data
temporal-setup-search:
image: temporalio/admin-tools:1.23.1.0
environment:
TEMPORAL_ADDRESS: temporal:7233
entrypoint: bash -c 'temporal operator search-attribute create --name ManuscriptId --type Text && temporal operator search-attribute create --name DocmapURL --type Text'
depends_on:
temporal:
condition: service_healthy
temporal-ui:
image: temporalio/ui:2.34.0
ports:
- 8233:8233
environment:
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_UI_PORT: 8233
healthcheck:
test: curl http://localhost:8233 -I
depends_on:
temporal:
condition: service_healthy
yarn:
build:
context: .
target: deps
command: yarn
volumes:
- ./package.json:/app/package.json
- ./yarn.lock:/app/yarn.lock
- node_modules:/app/node_modules
worker:
build:
context: .
target: worker
depends_on:
createbucket:
condition: service_completed_successfully
yarn:
condition: service_completed_successfully
temporal-setup-search:
condition: service_completed_successfully
temporal:
condition: service_healthy
encoda:
condition: service_healthy
xslt:
condition: service_healthy
api:
condition: service_healthy
environment:
EPP_SERVER_URI: http://api:3000
TEMPORAL_SERVER: temporal:7233
TASK_QUEUE_NAME: epp
# EPP S3 bucket
S3_ENDPOINT: http://minio:9000
AWS_ACCESS_KEY_ID: minio
AWS_SECRET_ACCESS_KEY: miniotest
BUCKET_NAME: epp
# Meca S3 Bucket (on minio)
MECA_S3_ENDPOINT: http://minio:9000
MECA_AWS_ACCESS_KEY_ID: minio
MECA_AWS_SECRET_ACCESS_KEY: miniotest
# other services
XSLT_TRANSFORM_ADDRESS: http://xslt:80
ENCODA_TRANSFORM_ADDRESS: http://encoda:3000
restart: on-failure
command:
- yarn
- start:worker:dev
healthcheck:
test: curl -s http://localhost:9464/metrics | grep 'temporal_worker_start{namespace="default",service_name="temporal-core-sdk",task_queue="epp"}' | grep 1
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
volumes:
- ./src:/app/src
- node_modules:/app/node_modules
docmaps-worker:
build:
context: .
target: worker
depends_on:
createbucket:
condition: service_completed_successfully
yarn:
condition: service_completed_successfully
temporal-setup-search:
condition: service_completed_successfully
temporal:
condition: service_healthy
encoda:
condition: service_healthy
xslt:
condition: service_healthy
api:
condition: service_healthy
environment:
EPP_SERVER_URI: http://api:3000
TEMPORAL_SERVER: temporal:7233
TASK_QUEUE_NAME: epp
TEMPORAL_TASK_QUEUE: import-docmaps
# EPP S3 bucket
S3_ENDPOINT: http://minio:9000
AWS_ACCESS_KEY_ID: minio
AWS_SECRET_ACCESS_KEY: miniotest
BUCKET_NAME: epp
# Meca S3 Bucket (on minio)
MECA_S3_ENDPOINT: http://minio:9000
MECA_AWS_ACCESS_KEY_ID: minio
MECA_AWS_SECRET_ACCESS_KEY: miniotest
# other services
XSLT_TRANSFORM_ADDRESS: http://xslt:80
ENCODA_TRANSFORM_ADDRESS: http://encoda:3000
restart: on-failure
command:
- yarn
- start:worker:dev
healthcheck:
test: curl -s http://localhost:9464/metrics | grep 'temporal_worker_start{namespace="default",service_name="temporal-core-sdk",task_queue="import-docmaps"}' | grep 1
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
volumes:
- ./src:/app/src
- node_modules:/app/node_modules
# Downstream services for EPP
## Database (MongoDB) server
mongodb:
image: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: testtest
volumes:
- mongodb_data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh mongodb:27017/test -u admin -p testtest --authenticationDatabase admin --quiet
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
## Database (MongoDB) GUI
mongo-express:
image: mongo-express
environment:
- ME_CONFIG_OPTIONS_EDITORTHEME=dracula
- ME_CONFIG_MONGODB_SERVER=mongodb
- ME_CONFIG_MONGODB_ENABLE_ADMIN=true
- ME_CONFIG_MONGODB_AUTH_USERNAME=admin
- ME_CONFIG_MONGODB_AUTH_PASSWORD=testtest
depends_on:
mongodb:
condition: service_healthy
ports:
- "8081:8081"
## BIORXIV XSLT
xslt:
image: ghcr.io/elifesciences/enhanced-preprints-biorxiv-xslt-api:master-30d97395-20250115.1118
healthcheck:
test: "curl -H 'X-Passthrough: true' -f http://localhost:80/ -d '<test></test>' || exit 1"
interval: 60s
timeout: 60s
retries: 3
start_period: 60s
restart: always
ports:
- 3004:80
## ENCODA API
encoda:
image: ghcr.io/elifesciences/enhanced-preprints-encoda:master-da08f0ec-20250113.1939
healthcheck:
test: "wget --post-data '<test></test>' -O - http://localhost:3000/"
interval: 10s
timeout: 5s
retries: 3
start_period: 3s
restart: always
ports:
- 3005:3000
## EPP API
api:
image: ghcr.io/elifesciences/enhanced-preprints-server:master-c074bcc5-20250111.0112
healthcheck:
test: sh -c 'apk add curl; curl http://localhost:3000/'
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
depends_on:
mongodb:
condition: service_healthy
environment:
REPO_TYPE: MongoDB
REPO_CONNECTION: mongodb:27017
REPO_USERNAME: admin
REPO_PASSWORD: testtest
ports:
- 3000:3000
app:
image: ghcr.io/elifesciences/enhanced-preprints-client:master-c2fa68f7-20250114.1457
healthcheck:
test: sh -c 'apk add curl; curl http://app:3000/'
interval: 5s
timeout: 5s
retries: 20
start_period: 30s
environment:
NEXT_PUBLIC_SITE_NAME: ${NEXT_PUBLIC_SITE_NAME:-elife}
API_SERVER: http://api:3000
NEXT_PUBLIC_IMAGE_SERVER: /iiif
MANUSCRIPT_CONFIG_FILE: /opt/epp-client/data/manuscripts.json
IS_AUTOMATED: true
depends_on:
api:
condition: service_healthy
ports:
- 3001:3000
## Image Server
image-server:
image: ghcr.io/elifesciences/epp-image-server:master-1fdda8a5-20241217.0916
environment:
SOURCE_STATIC: S3Source
S3SOURCE_ENDPOINT: http://minio:9000/
S3SOURCE_ACCESS_KEY_ID: minio
S3SOURCE_SECRET_KEY: miniotest
S3SOURCE_BASICLOOKUPSTRATEGY_PATH_PREFIX: /automation/
S3SOURCE_BASICLOOKUPSTRATEGY_BUCKET_NAME: epp
ports:
- "8182:8182"
healthcheck:
test: curl http://image-server:8182/
interval: 5s
timeout: 5s
retries: 10
start_period: 2s
## Expose API, client and IIIF via proxy
nginx:
image: nginx:latest
depends_on:
api:
condition: service_healthy
app:
condition: service_healthy
ports:
- 8080:80
volumes:
- ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf
volumes:
minio_storage:
mongodb_data:
mysql_data:
temporal_data:
node_modules: