-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathdocker-compose.yml
208 lines (194 loc) · 6.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
name: wbs-deploy
services:
# --------------------------------------------------
# A. CORE WIKIBASE SUITE SERVICES
# --------------------------------------------------
wikibase:
image: wikibase/wikibase:3
depends_on:
mysql:
condition: service_healthy
elasticsearch:
condition: service_healthy
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.wikibase.rule=Host(`${WIKIBASE_PUBLIC_HOST}`)"
volumes:
- ./config:/config
- wikibase-image-data:/var/www/html/images
- quickstatements-data:/quickstatements/data
environment:
MW_ADMIN_NAME: ${MW_ADMIN_NAME}
MW_ADMIN_PASS: ${MW_ADMIN_PASS}
MW_ADMIN_EMAIL: ${MW_ADMIN_EMAIL}
MW_WG_SERVER: https://${WIKIBASE_PUBLIC_HOST}
DB_SERVER: mysql:3306
DB_USER: ${DB_USER}
DB_PASS: ${DB_PASS}
DB_NAME: ${DB_NAME}
ELASTICSEARCH_HOST: elasticsearch
QUICKSTATEMENTS_PUBLIC_URL: https://${QUICKSTATEMENTS_PUBLIC_HOST}
healthcheck:
test: curl --silent --fail localhost/wiki/Main_Page
interval: 10s
start_period: 5m
wikibase-jobrunner:
image: wikibase/wikibase:3
command: /jobrunner-entrypoint.sh
depends_on:
wikibase:
condition: service_healthy
restart: unless-stopped
volumes_from:
- wikibase
mysql:
image: mariadb:10.11
restart: unless-stopped
volumes:
- mysql-data:/var/lib/mysql
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASS}
MYSQL_RANDOM_ROOT_PASSWORD: yes
healthcheck:
test: healthcheck.sh --connect --innodb_initialized
start_period: 1m
interval: 20s
timeout: 5s
# --------------------------------------------------
# B. EXTRA WIKIBASE SUITE SERVICES
# --------------------------------------------------
# To disable Elasticsearch and use default MediaWiki search functionality remove
# the elasticsearch service, and the MW_ELASTIC_* vars from wikibase_variables
# at the top of this file.
elasticsearch:
image: wikibase/elasticsearch:1
restart: unless-stopped
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
environment:
discovery.type: single-node
ES_JAVA_OPTS: -Xms512m -Xmx512m -Dlog4j2.formatMsgNoLookups=true
healthcheck:
test: curl --silent --fail localhost:9200
interval: 10s
start_period: 2m
wdqs:
image: wikibase/wdqs:2
command: /runBlazegraph.sh
depends_on:
wikibase:
condition: service_healthy
restart: unless-stopped
# Set number of files ulimit high enough, otherwise blazegraph will abort with:
# library initialization failed - unable to allocate file descriptor table - out of memory
# Appeared on Docker 24.0.5, containerd 1.7.9, Linux 6.6.6, NixOS 23.11
ulimits:
nofile:
soft: 32768
hard: 32768
volumes:
- wdqs-data:/wdqs/data
healthcheck:
test: curl --silent --fail localhost:9999/bigdata/namespace/wdq/sparql
interval: 10s
start_period: 2m
wdqs-updater:
image: wikibase/wdqs:2
command: /runUpdate.sh
depends_on:
wdqs:
condition: service_healthy
restart: unless-stopped
# Set number of files ulimit high enough, otherwise blazegraph will abort with:
# library initialization failed - unable to allocate file descriptor table - out of memory
# Appeared on Docker 24.0.5, containerd 1.7.9, Linux 6.6.6, NixOS 23.11
ulimits:
nofile:
soft: 32768
hard: 32768
environment:
WIKIBASE_CONCEPT_URI: https://${WIKIBASE_PUBLIC_HOST}
wdqs-proxy:
image: wikibase/wdqs-proxy:1
depends_on:
wdqs:
condition: service_healthy
restart: unless-stopped
wdqs-frontend:
image: wikibase/wdqs-frontend:1
depends_on:
- wdqs-proxy
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.wdqs-frontend.rule=Host(`${WDQS_FRONTEND_PUBLIC_HOST}`)"
environment:
WDQS_HOST: wdqs-proxy
healthcheck:
test: curl --silent --fail localhost
interval: 10s
start_period: 2m
quickstatements:
image: wikibase/quickstatements:1
depends_on:
wikibase:
condition: service_healthy
restart: unless-stopped
volumes:
- quickstatements-data:/quickstatements/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.quickstatements.rule=Host(`${QUICKSTATEMENTS_PUBLIC_HOST}`)"
environment:
QUICKSTATEMENTS_PUBLIC_URL: https://${QUICKSTATEMENTS_PUBLIC_HOST}
WIKIBASE_PUBLIC_URL: https://${WIKIBASE_PUBLIC_HOST}
healthcheck:
test: curl --silent --fail localhost
interval: 10s
start_period: 2m
# --------------------------------------------------
# C. REVERSE PROXY AND SSL SERVICES
# --------------------------------------------------
traefik:
image: traefik:3.1
command:
# Basic setup
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
# http endpoint
- "--entrypoints.web.address=:80"
# https endpoint
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.asdefault"
- "--entrypoints.websecure.http.tls.certresolver=letsencrypt"
# http to https redirect
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
# ACME SSL certificate generation
- "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.letsencrypt.acme.email=${MW_ADMIN_EMAIL}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
# Uncomment this line to only test ssl generation first, makes sure you don't run into letsencrypt rate limits
# - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-letsencrypt-data:/letsencrypt
volumes:
# A. CORE WIKIBASE SUITE SERVICES DATA
wikibase-image-data:
mysql-data:
# B. EXTRA WIKIBASE SUITE SERVICES DATA
wdqs-data:
elasticsearch-data:
quickstatements-data:
# C. REVERSE PROXY AND SSL SERVICES DATA
traefik-letsencrypt-data: