forked from metin2/deploy
Added database initialization mechanism, support for in-game mall
This commit is contained in:
@ -16,7 +16,8 @@ x-environment:
|
||||
|
||||
PUBLIC_IP: ${PUBLIC_IP}
|
||||
GAME_MAX_LEVEL: ${GAME_MAX_LEVEL}
|
||||
GAME_MALL_URL: ${GAME_MALL_URL}
|
||||
WEB_APP_URL: ${WEB_APP_URL}
|
||||
WEB_APP_KEY: ${WEB_APP_KEY}
|
||||
|
||||
services:
|
||||
# MySQL Database
|
||||
@ -25,15 +26,55 @@ services:
|
||||
restart: on-failure
|
||||
environment:
|
||||
# Password for root access
|
||||
MYSQL_ROOT_PASSWORD: 'metin2'
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
|
||||
ports:
|
||||
- '${MYSQL_EXTERNAL_PORT}:${MYSQL_PORT}'
|
||||
expose:
|
||||
- ${MYSQL_PORT}
|
||||
volumes:
|
||||
- ./storage/database/:/var/lib/mysql/
|
||||
- ./assets/db-init/:/docker-entrypoint-initdb.d/:ro
|
||||
healthcheck:
|
||||
test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p$$MYSQL_ROOT_PASSWORD' ]
|
||||
test: mysqladmin ping -h localhost -u root -p$$MYSQL_ROOT_PASSWORD
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# Web management system
|
||||
web:
|
||||
image: ${WEB_IMAGE}
|
||||
restart: on-failure
|
||||
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: ${MYSQL_HOST}
|
||||
DB_PORT: ${MYSQL_PORT}
|
||||
DB_USERNAME: ${MYSQL_USER}
|
||||
DB_PASSWORD: ${MYSQL_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:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: curl --fail http://localhost:80/ || exit 1
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
@ -51,6 +92,8 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
|
||||
# Auth server
|
||||
auth:
|
||||
@ -75,6 +118,8 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
|
||||
# Game server (CH1)
|
||||
ch1_first:
|
||||
@ -100,6 +145,8 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
|
||||
ch1_game1:
|
||||
image: ${GAME_IMAGE}
|
||||
@ -123,6 +170,8 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
|
||||
ch1_game2:
|
||||
image: ${GAME_IMAGE}
|
||||
@ -146,6 +195,8 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
|
||||
# Game server (game99)
|
||||
game99:
|
||||
@ -170,3 +221,5 @@ services:
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
|
Reference in New Issue
Block a user