forked from azerothcore/azerothcore-wotlk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
395 lines (369 loc) · 13.4 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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
version: '3.9'
# extension field: https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
x-networks: &networks
networks:
- ac-network
x-build-params: &build-params
context: .
dockerfile: ./apps/docker/Dockerfile
args:
USER_ID: ${DOCKER_USER_ID:-1000}
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
DOCKER_USER: ${DOCKER_USER:-acore}
# BUILDKIT_INLINE_CACHE: 1
cache_from:
- acore/ac-wotlk-authserver:${DOCKER_IMAGE_TAG:-master}
- acore/ac-wotlk-authserver-local:${DOCKER_IMAGE_TAG:-master}
- acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master}
- acore/ac-wotlk-worldserver-local:${DOCKER_IMAGE_TAG:-master}
- acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
- acore/ac-wotlk-tools:${DOCKER_IMAGE_TAG:-master}
# Need to fix reduced space on GH actions first
# - acore/ac-wotlk-client-data:${DOCKER_IMAGE_TAG:-master}
x-ac-shared-conf: &ac-shared-conf
<<: *networks
working_dir: /azerothcore
environment:
AC_DISABLE_INTERACTIVE: "1"
x-ac-service-conf: &ac-service-conf
<<: *ac-shared-conf
# List can't be merged. See: https://forums.docker.com/t/how-to-merge-a-list-of-volumes-from-an-extension-field-into-the-service-definition/77454
# volumes:
# - ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
# # [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
# - ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
services:
#=======================
#
# DATABASE
#
#=======================
ac-database:
<<: *networks
image: mysql:8.0
restart: unless-stopped
cap_add:
- SYS_NICE # CAP_SYS_NICE
ports:
- ${DOCKER_DB_EXTERNAL_PORT:-3306}:3306
environment:
- MYSQL_ROOT_PASSWORD=${DOCKER_DB_ROOT_PASSWORD:-password}
volumes:
- type: volume
source: ac-database
target: /var/lib/mysql
healthcheck:
test: "/usr/bin/mysql --user=root --password=$$MYSQL_ROOT_PASSWORD --execute \"SHOW DATABASES;\""
interval: 5s
timeout: 10s
retries: 40
#======================
#
# Dev services
#
#======================
#
# Used for the build process to avoid the host binding of the /azerothcore
# and speedup the compilation by avoiding the host-container filesystem conversion issue
# on non-ext filesystems. Reference https://stackoverflow.com/a/63437557/1964544
#
ac-dev-build:
<<: [ *ac-shared-conf ] # merge with
image: acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
user: ${DOCKER_USER:-root}
cap_add:
- SYS_NICE # CAP_SYS_NICE
build:
target: dev
<<: *build-params
security_opt:
- seccomp:unconfined
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
volumes:
# expose some dist folder outside allowing the host to use them
- ${DOCKER_VOL_CONF:-./conf}:/azerothcore/conf
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
- ac-build-dev:/azerothcore/var/build
- ac-ccache-dev:/azerothcore/var/ccache
profiles: [dev-build]
#
# Dev server with the ./azerothcore folder binded from the host
# Please use Linux, WSL2 or any ext-compatible filesystem
# to avoid performance issues
#
ac-dev-server:
<<: [ *ac-shared-conf ] # merge with
tty: true
image: acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
user: ${DOCKER_USER:-root}
cap_add:
- SYS_NICE # CAP_SYS_NICE
build:
target: dev
<<: *build-params
security_opt:
- seccomp:unconfined
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
ports:
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
volumes:
- ${DOCKER_VOL_ROOT:-.}:/azerothcore:cached
# expose some dist folder outside allowing the host to use them
- ${DOCKER_VOL_CONF:-./conf}:/azerothcore/conf
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
- ac-build-dev:/azerothcore/var/build
- ac-ccache-dev:/azerothcore/var/ccache
# client data
- ${DOCKER_VOL_DATA_CAMERAS:-./env/docker/data/Cameras}:/azerothcore/env/dist/data/Cameras
- ${DOCKER_VOL_DATA_DBC:-./env/docker/data/dbc}:/azerothcore/env/dist/data/dbc
- ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/data/maps
- ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/data/vmaps
- ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/data/mmaps
# remount again for the extractors
- ${DOCKER_VOL_DATA_CAMERAS:-./env/docker/data/Cameras}:/azerothcore/env/dist/bin/Cameras
- ${DOCKER_VOL_DATA_DBC:-./env/docker/data/dbc}:/azerothcore/env/dist/bin/dbc
- ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/bin/maps
- ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/bin/vmaps
- ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/bin/mmaps
# this is not the directory of the extracted data! It's the client folder used by the extractors
- ${DOCKER_AC_CLIENT_FOLDER:-./var/client}:/azerothcore/env/dist/bin/Data
profiles: [dev]
depends_on:
ac-database:
condition: service_healthy
ac-db-import:
<<: *ac-shared-conf
image: acore/ac-wotlk-worldserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
command: ./env/dist/bin/dbimport
volumes:
# read-only binaries compiled by ac-dev-server
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
profiles: [local, app, db-import-local]
depends_on:
ac-database:
condition: service_healthy
#=======================
#
# APP Services
#
#=======================
ac-worldserver:
<<: *ac-service-conf # merge with ac-service-conf
stdin_open: true
tty: true
cap_add:
- SYS_NICE # CAP_SYS_NICE
command: ./acore.sh run-worldserver
image: acore/ac-wotlk-worldserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
restart: unless-stopped
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
user: ${DOCKER_USER:-root}
privileged: true
build:
target: worldserver-local
<<: *build-params
ports:
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
volumes:
# read-only binaries compiled by ac-dev-server
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
# client data
- ${DOCKER_VOL_DATA_CAMERAS:-./env/docker/data/Cameras}:/azerothcore/env/dist/data/Cameras
- ${DOCKER_VOL_DATA_DBC:-./env/docker/data/dbc}:/azerothcore/env/dist/data/dbc
- ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/data/maps
- ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/data/vmaps
- ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/data/mmaps
profiles: [local, app, worldserver]
depends_on:
ac-database:
condition: service_healthy
ac-db-import:
condition: service_completed_successfully
ac-authserver:
<<: *ac-service-conf # merge with ac-service-conf
tty: true
command: ./acore.sh run-authserver
image: acore/ac-wotlk-authserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
restart: unless-stopped
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
user: ${DOCKER_USER:-root}
build:
target: authserver-local
<<: *build-params
volumes:
# read-only binaries compiled by ac-dev-server
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
ports:
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
profiles: [local, app, authserver]
depends_on:
ac-database:
condition: service_healthy
ac-db-import:
condition: service_completed_successfully
#======================
#
# Production services
#
# The following services are used to test the production images
# Do not use them unless you know what you're doing!
# We do not offer support for them
#
# For a production-ready docker-compose, please check the official repo: https://github.com/azerothcore/acore-docker
#
#======================
ac-database-prod:
<<: *networks
image: mysql:8.0
restart: unless-stopped
cap_add:
- SYS_NICE # CAP_SYS_NICE
ports:
- ${DOCKER_DB_EXTERNAL_PORT:-3306}:3306
environment:
- MYSQL_ROOT_PASSWORD=${DOCKER_DB_ROOT_PASSWORD:-password}
volumes:
- type: volume
source: ac-database-prod
target: /var/lib/mysql
healthcheck:
test: "/usr/bin/mysql --user=root --password=$$MYSQL_ROOT_PASSWORD --execute \"SHOW DATABASES;\""
interval: 5s
timeout: 10s
retries: 40
profiles: [prod]
ac-worldserver-prod:
<<: *ac-service-conf # merge with ac-service-conf
stdin_open: true
tty: true
cap_add:
- SYS_NICE # CAP_SYS_NICE
command: ./acore.sh run-worldserver
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
restart: unless-stopped
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
user: ${DOCKER_USER:-root}
privileged: true
build:
target: worldserver
<<: *build-params
ports:
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
volumes:
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
- ${DOCKER_VOL_CLIENT_DATA_PROD:-ac-client-data-prod}:/azerothcore/env/dist/data:ro
profiles: [prod, prod-app, prod-worldserver]
depends_on:
ac-database-prod:
condition: service_healthy
ac-db-import-prod:
condition: service_completed_successfully
ac-client-data-init:
condition: service_started
ac-authserver-prod:
<<: *ac-service-conf # merge with ac-service-conf
tty: true
command: ./acore.sh run-authserver
image: acore/ac-wotlk-authserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
restart: unless-stopped
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
user: ${DOCKER_USER:-root}
build:
target: authserver
<<: *build-params
volumes:
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
ports:
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
profiles: [prod, prod-app, prod-authserver]
depends_on:
ac-database-prod:
condition: service_healthy
ac-db-import-prod:
condition: service_completed_successfully
ac-client-data-init:
image: acore/ac-wotlk-client-data:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
user: ${DOCKER_USER:-root}
build:
target: client-data
<<: *build-params
args:
USER_ID: ${DOCKER_USER_ID:-1000}
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
DOCKER_USER: ${DOCKER_USER:-acore}
# BUILDKIT_INLINE_CACHE: 1
volumes:
- ${DOCKER_VOL_CLIENT_DATA_PROD:-ac-client-data-prod}:/azerothcore/env/dist/data:ro
profiles: [prod, prod-app, clientdata]
ac-tools:
image: acore/ac-wotlk-tools:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
user: ${DOCKER_USER:-root}
build:
target: tools
<<: *build-params
working_dir: /azerothcore/env/client/
volumes:
# this is not the directory of the extracted data! It's the client folder used by the extractors
- ${DOCKER_AC_CLIENT_FOLDER:-./var/client}:/azerothcore/env/dist/bin/Data
profiles: [prod, tools]
ac-db-import-prod:
<<: *ac-shared-conf
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
command: ./env/dist/bin/dbimport
profiles: [prod, prod-app, db-import-prod]
#
# Only for internal tests
#
ac-build-prod:
<<: *ac-shared-conf
build:
target: build
<<: *build-params
env_file:
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
working_dir: /azerothcore/
profiles: [prod-build]
volumes:
ac-database:
ac-database-prod:
ac-bin-dev:
ac-build-dev:
ac-ccache-dev:
ac-proj:
ac-client-data-prod:
# not used, but you can use them by setting
# the DOCKER_VOL_* env variabiles
ac-root:
ac-conf:
ac-etc:
ac-logs:
ac-client-data-cameras:
ac-client-data-dbc:
ac-client-data-maps:
ac-client-data-vmaps:
ac-client-data-mmaps:
networks:
ac-network: