deploy/docker-compose.yml

315 lines
6.9 KiB
YAML

x-environment: &common-environment
MARIADB_HOST: ${MARIADB_HOST}
MARIADB_USER: ${MARIADB_USER}
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
MARIADB_PORT: ${MARIADB_PORT}
MARIADB_DB: ${MARIADB_DB}
TEST_SERVER: ${TEST_SERVER}
DB_ADDR: ${DB_ADDR}
DB_PORT: ${DB_PORT}
PUBLIC_IP: ${PUBLIC_IP}
GAME_MAX_LEVEL: ${GAME_MAX_LEVEL}
WEB_APP_URL: ${WEB_APP_URL}
WEB_APP_KEY: ${WEB_APP_KEY}
name: Metin2
services:
# MariaDB Database
mariadb:
image: mariadb:lts
restart: always
environment:
# Password for root access
MARIADB_ROOT_PASSWORD: ${MARIADB_PASSWORD}
ports:
- "${MARIADB_EXTERNAL_PORT}:${MARIADB_PORT}"
expose:
- ${MARIADB_PORT}
volumes:
- ./storage/database/:/var/lib/mysql/
- ./assets/db-init/:/docker-entrypoint-initdb.d/:ro
healthcheck:
test:
[
"CMD",
"healthcheck.sh",
"--su-mysql",
"--connect",
"--innodb_initialized",
]
interval: 10s
timeout: 5s
retries: 5
networks:
- metin2
# Web management system
web:
image: ${WEB_IMAGE}
restart: always
environment:
# Application config
APP_NAME: ${WEB_APP_NAME}
APP_ENV: ${WEB_APP_ENV}
APP_KEY: ${WEB_APP_KEY}
APP_URL: ${WEB_APP_URL}
# Database credentials
DB_HOST: ${MARIADB_HOST}
DB_PORT: ${MARIADB_PORT}
DB_DATABASE: ${MARIADB_DB}
DB_USERNAME: ${MARIADB_USER}
DB_PASSWORD: ${MARIADB_PASSWORD}
# E-mail config
MAIL_MAILER: ${WEB_MAIL_MAILER}
MAIL_HOST: ${WEB_MAIL_HOST}
MAIL_PORT: ${WEB_MAIL_PORT}
MAIL_USERNAME: ${WEB_MAIL_USERNAME}
MAIL_PASSWORD: ${WEB_MAIL_PASSWORD}
MAIL_ENCRYPTION: ${WEB_MAIL_ENCRYPTION}
MAIL_FROM_ADDRESS: ${WEB_MAIL_FROM_ADDRESS}
MAIL_FROM_NAME: ${WEB_MAIL_FROM_NAME}
ports:
- "${WEB_EXTERNAL_PORT}:80"
volumes:
- ./storage/web/:/app/storage/
depends_on:
mariadb:
condition: service_healthy
healthcheck:
test: curl --fail http://localhost:80/ || exit 1
interval: 10s
timeout: 5s
retries: 5
networks:
- metin2
# DBCache Server
db:
image: ${GAME_IMAGE}
restart: always
environment: *common-environment
expose:
- ${DB_PORT}
command: db
volumes:
- ./storage/log/db/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
# Auth server
auth:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
MARIADB_DB: ${MARIADB_DB}
GAME_HOSTNAME: auth
GAME_CHANNEL: 1
GAME_AUTH_SERVER: master
GAME_PORT: 11000
GAME_P2P_PORT: 12000
expose:
- 11000
- 12000
ports:
- "11000:11000"
command: game
volumes:
- ./storage/log/auth/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
# Game server (CH1)
ch1_first:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_first
GAME_CHANNEL: 1
GAME_MARK_SERVER: 1
GAME_PORT: 13000
GAME_P2P_PORT: 14000
GAME_MAP_ALLOW: 1 3 4 5 6 21 23 24 25 26 41 43 44 45 46 91 92 93 107 112 201
expose:
- 13000
- 14000
ports:
- "13000:13000"
command: game
volumes:
- ./storage/log/ch1/first/:/app/log/
- ./storage/mark/:/app/mark/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
ch1_game1:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game1
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13001
GAME_P2P_PORT: 14001
GAME_MAP_ALLOW: 61 62 67 68 72 73 208 351 352 356
expose:
- 13001
- 14001
ports:
- "13001:13001"
command: game
volumes:
- ./storage/log/ch1/game1/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
ch1_game2:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game2
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13002
GAME_P2P_PORT: 14002
GAME_MAP_ALLOW: 63 64 65 66 69 70 71 104 108 109 216 217
expose:
- 13002
- 14002
ports:
- "13002:13002"
command: game
volumes:
- ./storage/log/ch1/game2/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
ch1_game3:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game3
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13003
GAME_P2P_PORT: 14003
GAME_MAP_ALLOW: 301 302 303 304 353 354 358 359 378 379 380 381
expose:
- 13003
- 14003
ports:
- "13003:13003"
command: game
volumes:
- ./storage/log/ch1/game3/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
ch1_game4:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game4
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13004
GAME_P2P_PORT: 14004
GAME_MAP_ALLOW: 373 374 376 377 382 383 384 385 386 387 388 389 390 391 393 394 395
expose:
- 13004
- 14004
ports:
- "13004:13004"
command: game
volumes:
- ./storage/log/ch1/game4/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
ch1_game5:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: ch1_game5
GAME_CHANNEL: 1
GAME_MARK_SERVER: 0
GAME_PORT: 13005
GAME_P2P_PORT: 14005
GAME_MAP_ALLOW: 355 357 360 361 362 372 375 396 399 404 405 406 407 408 409 410 411 412 413 414 415 419 420
expose:
- 13005
- 14005
ports:
- "13005:13005"
command: game
volumes:
- ./storage/log/ch1/game5/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
# Game server (game99)
game99:
image: ${GAME_IMAGE}
restart: always
environment:
<<: *common-environment
GAME_HOSTNAME: game99
GAME_CHANNEL: 99
GAME_MARK_SERVER: 0
GAME_PORT: 13099
GAME_P2P_PORT: 14099
GAME_MAP_ALLOW: 81 103 105 110 111 113 114 118 119 120 121 122 123 124 125 126 127 128 130 131 132 133 181 182 183 200 392 363 364 365 366 367 368 369 370 371 400 401 402 403
expose:
- 13099
- 14099
ports:
- "13099:13099"
command: game
volumes:
- ./storage/log/game99/:/app/log/
depends_on:
mariadb:
condition: service_healthy
networks:
- metin2
networks:
metin2:
name: metin2-network