-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
349 lines (330 loc) · 11.2 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
version: '3.4'
x-elasticsearch-image: &elasticsearch-image
docker-registry.wikimedia.org/releng/cirrus-elasticsearch:7.10.2-s0
x-formulasearch-image: &formulasearch-image
ghcr.io/mardi4nfdi/formulasearch:main
x-mongo-image: &mongo-image
mongo:6.0
x-mysql-image: &mysql-image
mariadb:10.11
x-portainer-image: &portainer-image
portainer/portainer-ce
x-quickstatements-image: &quickstatements-image
ghcr.io/wmde/wikibase/quickstatements:7657478403
x-redis: &redis-image
redis:7
x-redis-jobrunner: &redis-jobrunner-image
ghcr.io/mardi4nfdi/docker-redis-jobrunner
x-traefik-image: &traefik-image
traefik:v2.8
x-wikibase: &wikibase-image
ghcr.io/mardi4nfdi/docker-wikibase:1.44
x-wdqs-image: &wdqs-image
ghcr.io/wmde/wikibase/wdqs:dev-9186217118
x-wdqs-frontend-image: &wdqs-frontend-image
ghcr.io/wmde/wikibase/wdqs-frontend:dev-9186217118
x-wdqs-proxy-image: &wdqs-proxy-image
ghcr.io/wmde/wikibase/wdqs-proxy:dev-9186217118
x-common-variables: &wikibase_variables
DB_SERVER: mysql.svc:3306
MW_ADMIN_NAME: ${MW_ADMIN_NAME:-admin}
MW_ADMIN_PASS: ${MW_ADMIN_PASS}
MW_ADMIN_EMAIL: ${MW_ADMIN_EMAIL:[email protected]}
MW_WG_SECRET_KEY: ${MW_SECRET_KEY}
MW_WG_JOB_RUN_RATE: 0
DB_USER: ${DB_USER:-sqluser}
DB_PASS: ${DB_PASS}
DB_NAME: ${DB_NAME:-my_wiki}
MSC_USER: ${MSC_USER}
MSC_PASS: ${MSC_PASS}
DEPLOYMENT_ENV: ${DEPLOYMENT_ENV:-local}
WIKIBASE_SCHEME: ${WIKIBASE_SCHEME:-https}
WIKIBASE_HOST: ${WIKIBASE_HOST:-portal.mardi4nfdi.de}
WIKIBASE_PORT: ${WIKIBASE_PORT:-80}
WIKIBASE_PINGBACK: ${WIKIBASE_PINGBACK:-false}
MW_WG_ENABLE_UPLOADS: ${MW_WG_ENABLE_UPLOADS:-false}
QS_PUBLIC_SCHEME_HOST_AND_PORT: https://quickstatements.${WIKIBASE_HOST}
TRAEFIK_PW: ${TRAEFIK_PW}
MATOMO_TOKEN: ${MATOMO_TOKEN}
GOOGLE_OPENID_SECRET: ${GOOGLE_OPENID_SECRET}
NFDI_AAI_SECRET: ${NFDI_AAI_SECRET}
MW_ELASTIC_HOST: ${MW_ELASTIC_HOST:-elasticsearch.svc}
MW_ELASTIC_PORT: ${MW_ELASTIC_PORT:-9200}
services:
wikibase:
image: *wikibase-image
container_name: mardi-wikibase
links:
- mysql
- mongo
- formulasearch
depends_on:
- mysql
- mongo
restart: unless-stopped
volumes:
## This shares the configuration with jobrunner
- shared_mardi_wikibase:/shared/:rw
- ./mediawiki/LocalSettings.d:/shared/LocalSettings.d
- ./mediawiki/LocalSettings.d:/var/www/html/LocalSettings.d
- shared_mediawiki_images:/var/www/html/images/:rw
- quickstatements-data:/quickstatements/data
- formulasearch_harvests:/var/www/html/my_harvests/
- apache_logs:/var/log/apache2/
networks:
default:
aliases:
- wikibase-docker.svc
- wikibase.svc
environment:
<<: *wikibase_variables
labels:
- traefik.http.routers.service-wikibase.rule=Host(`${WIKIBASE_HOST}`,`swmath.${WIKIBASE_HOST}`,`staging.swmath.org`)
- traefik.http.routers.service-wikibase.entrypoints=websecure
- traefik.http.routers.service-wikibase.tls.certResolver=le
- traefik.http.routers.service-wikibase.service=wikibase-service
- traefik.http.services.wikibase-service.loadbalancer.server.port=80
- traefik.http.routers.service-wikimongo.rule=Host(`wikimongo.${WIKIBASE_HOST}`)
- traefik.http.routers.service-wikimongo.entrypoints=websecure
- traefik.http.routers.service-wikimongo.tls.certResolver=le
- traefik.http.routers.service-wikimongo.service=wikimongo-service
- traefik.http.services.wikimongo-service.loadbalancer.server.port=8081
mysql:
image: *mysql-image
container_name: mardi-mysql
restart: unless-stopped
volumes:
- mediawiki-mysql-data:/var/lib/mysql
- ./my.cnf:/etc/mysql/conf.d/my.cnf
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
networks:
default:
aliases:
- mysql.svc
- tools.labsdb
mongo:
image: *mongo-image
container_name: mardi-mongo
restart: unless-stopped
volumes:
- mediawiki-mongo-data:/data/db
networks:
default:
aliases:
- mongodb
elasticsearch:
image: *elasticsearch-image
restart: unless-stopped
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
networks:
default:
aliases:
- elasticsearch.svc
environment:
discovery.type: single-node
ES_JAVA_OPTS: "-Xms8g -Xmx8g"
formulasearch:
image: *formulasearch-image
container_name: formulasearch
restart: "no"
environment:
HARVESTS_PATH: '/my_harvests'
# Port config 1985 is internal port and should not be changed currently.
FS_SERVER_PORT: 1985
ENABLE_REST_INSERTIONS: 'false'
CRON_UPDATE_FORMULAE: ${FS_CRON_UPDATE_FORMULAE}
CRON_ENABLED: ${FS_CRON_ENABLED:-false}
ALWAYS_EXPORT: ${FS_ALWAYS_EXPORT:-false}
volumes:
- formulasearch_harvests:/my_harvests/
- ${BACKUP_DIR:-./backup}:/data
redis:
container_name: redis
restart: unless-stopped
image: *redis-image
redis-jobrunner:
image: *redis-jobrunner-image
depends_on:
- wikibase
entrypoint:
- php
- /jobrunner/redisJobRunnerService
- "--config-file=/jobrunner/config.json"
volumes:
- ./redis-jobrunner-conf.json:/jobrunner/config.json:ro
- shared_mardi_wikibase:/shared/
- ./mediawiki/LocalSettings.d:/shared/LocalSettings.d:ro
environment:
<<: *wikibase_variables
redis-rescheduler:
image: *redis-jobrunner-image
depends_on:
- wikibase
volumes:
- ./redis-jobrunner-conf.json:/jobrunner/config.json:ro
- shared_mardi_wikibase:/shared/
- ./mediawiki/LocalSettings.d:/shared/LocalSettings.d:ro
wdqs-frontend:
image: *wdqs-frontend-image
container_name: mardi-wdqs-frontend
restart: unless-stopped
volumes:
- ./mediawiki/images/MaRDI_Logo_L_5_rgb_50p.svg:/usr/share/nginx/html/logo.svg
- ./mediawiki/images/favicon.ico:/usr/share/nginx/html/favicon.ico
depends_on:
- wdqs-proxy
- wikibase
networks:
default:
aliases:
- wdqs-frontend.svc
environment:
- WIKIBASE_HOST=wikibase.svc
- WDQS_HOST=wdqs-proxy.svc
- BRAND_TITLE=MaRDIQueryService
labels:
- traefik.http.routers.service-wdqs-frontend.rule=Host(`query.${WIKIBASE_HOST}`)
- traefik.http.routers.service-wdqs-frontend.entrypoints=websecure
- traefik.http.routers.service-wdqs-frontend.tls.certResolver=le
wdqs:
image: *wdqs-image
restart: unless-stopped
command: /runBlazegraph.sh
volumes:
- query-service-data:/wdqs/data
- ./wdqs/prefixes.conf:/wdqs/prefixes.conf:ro
- ./wdqs/allowlist.txt:/wdqs/allowlist.txt:ro
networks:
default:
aliases:
- wdqs.svc
environment:
- WIKIBASE_HOST=${WIKIBASE_HOST}
- WIKIBASE_SCHEME=${WIKIBASE_SCHEME:-https}
- WDQS_HOST=wdqs.svc
- WDQS_PORT=9999
- BLAZEGRAPH_OPTS='-Dorg.wikidata.query.rdf.tool.rdf.RdfRepository.timeout=3600'
expose:
- 9999
labels:
- traefik.http.routers.service-wdqs.rule=Host(`wdqs.${WIKIBASE_HOST}`)
- traefik.http.routers.service-wdqs.entrypoints=websecure
- traefik.http.routers.service-wdqs.tls.certResolver=le
- traefik.http.routers.service-wdqs.middlewares=auth
# cf https://github.com/MaRDI4NFDI/wikibase-release-pipeline/blob/main/build/WDQS-proxy/README.md
wdqs-proxy:
image: *wdqs-proxy-image
restart: unless-stopped
environment:
- PROXY_PASS_HOST=wdqs.svc:9999
- PROXY_MAX_QUERY_MILLIS=3600000
depends_on:
- wdqs
networks:
default:
aliases:
- wdqs-proxy.svc
labels:
- traefik.http.routers.wdqs-proxy.rule=Host(`sparql.${WIKIBASE_HOST}`)
- traefik.http.routers.wdqs-proxy.entrypoints=websecure
- traefik.http.routers.wdqs-proxy.tls.certResolver=le
wdqs-updater:
image: *wdqs-image
restart: unless-stopped
command: /runUpdate.sh
depends_on:
- wdqs
- wikibase
networks:
default:
aliases:
- wdqs-updater.svc
environment:
- WIKIBASE_HOST=${WIKIBASE_HOST}
- WIKIBASE_SCHEME=${WIKIBASE_SCHEME:-https}
- WDQS_HOST=wdqs.svc
- WDQS_PORT=9999
labels:
- traefik.enable=false
quickstatements:
image: *quickstatements-image
container_name: mardi-quickstatements
restart: unless-stopped
volumes:
- quickstatements-data:/quickstatements/data:ro
depends_on:
- wikibase
networks:
default:
aliases:
- quickstatements.${WIKIBASE_HOST}
labels:
- traefik.http.routers.service-quickstatements.rule=Host(`quickstatements.${WIKIBASE_HOST}`)
- traefik.http.routers.service-quickstatements.entrypoints=websecure
- traefik.http.routers.service-quickstatements.tls.certResolver=le
environment:
- QUICKSTATEMENTS_HOST=https://quickstatements.${WIKIBASE_HOST}
- WIKIBASE_SCHEME_AND_HOST=https://${WIKIBASE_HOST}
- QS_PUBLIC_SCHEME_HOST_AND_PORT=https://quickstatements.${WIKIBASE_HOST}
- WB_PUBLIC_SCHEME_HOST_AND_PORT=https://${WIKIBASE_HOST}
- WB_PROPERTY_NAMESPACE=122
- "WB_PROPERTY_PREFIX=Property:"
- WB_ITEM_NAMESPACE=120
- "WB_ITEM_PREFIX=Item:"
traefik:
restart: always
image: *traefik-image
container_name: reverse-proxy
ports:
- 443:443 # HTTPS port
- 80:80 # HTTP port
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
- ./traefik/traefik.yml:/etc/traefik/traefik.yml:ro
- ./traefik/conf/:/traefik-conf/:ro
- traefik-letsencrypt:/letsencrypt # Persistent file for ACME Setup (Certificate Store)
- ./traefik-log:/data/log # Persistent file for logging
networks:
- default
labels:
- traefik.http.routers.dashboard.rule=Host(`traefik.${WIKIBASE_HOST}`)
- traefik.http.routers.dashboard.entrypoints=websecure
- traefik.http.routers.dashboard.tls.certResolver=le
- traefik.http.routers.dashboard.service=api@internal
- traefik.http.routers.dashboard.middlewares=auth
- traefik.http.middlewares.auth.basicauth.users=mardi:$$2y$$05$$Ubl1B.74bDJkpGHXZ6Y4Xuq8lSx88bi51bmE85/VYf1nQizfKKuH.
portainer:
container_name: mardi-portainer
image: *portainer-image
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock # needs access to docker process
- portainer-data:/data # volume to save settings of portainer
labels:
- traefik.http.routers.service-portainer.rule=Host(`portainer.${WIKIBASE_HOST}`)
- traefik.http.routers.service-portainer.entrypoints=websecure
- traefik.http.routers.service-portainer.tls.certResolver=le
- traefik.http.services.portainer-docker.loadbalancer.server.port=9000
volumes:
apache_logs:
elasticsearch-data:
formulasearch_harvests:
LocalSettings:
mediawiki-mysql-data:
mediawiki-mongo-data:
portainer-data:
quickstatements-data:
query-service-data:
shared_mardi_wikibase:
shared_mediawiki_images:
traefik-letsencrypt:
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1450