forked from metin2/deploy
Added database initialization mechanism, support for in-game mall
This commit is contained in:
parent
bcdd9ac51b
commit
0a497f5a69
29
.env.example
29
.env.example
@ -1,4 +1,6 @@
|
|||||||
|
################################################################################
|
||||||
# MySQL settings
|
# MySQL settings
|
||||||
|
################################################################################
|
||||||
MYSQL_HOST=mysql
|
MYSQL_HOST=mysql
|
||||||
MYSQL_USER=root
|
MYSQL_USER=root
|
||||||
MYSQL_PASSWORD=metin2
|
MYSQL_PASSWORD=metin2
|
||||||
@ -9,6 +11,32 @@ MYSQL_DB_PLAYER=player
|
|||||||
MYSQL_DB_COMMON=common
|
MYSQL_DB_COMMON=common
|
||||||
MYSQL_DB_LOG=log
|
MYSQL_DB_LOG=log
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Web app settings
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# General configuration
|
||||||
|
WEB_IMAGE=git.old-metin2.com/metin2/website:nightly
|
||||||
|
WEB_APP_NAME=Metin2
|
||||||
|
WEB_APP_ENV=production
|
||||||
|
WEB_APP_URL=http://metin2.local
|
||||||
|
WEB_APP_KEY=
|
||||||
|
WEB_EXTERNAL_PORT=80
|
||||||
|
|
||||||
|
# E-mail configuration
|
||||||
|
WEB_MAIL_MAILER=smtp
|
||||||
|
WEB_MAIL_HOST=smtp.example.com
|
||||||
|
WEB_MAIL_PORT=587
|
||||||
|
WEB_MAIL_USERNAME=smtp-username
|
||||||
|
WEB_MAIL_PASSWORD=smtp-password
|
||||||
|
WEB_MAIL_ENCRYPTION=tls
|
||||||
|
WEB_MAIL_FROM_ADDRESS=no-reply@example.com
|
||||||
|
WEB_MAIL_FROM_NAME=Metin2
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Game server settings
|
||||||
|
################################################################################
|
||||||
|
|
||||||
# Global settings
|
# Global settings
|
||||||
TEST_SERVER=0
|
TEST_SERVER=0
|
||||||
|
|
||||||
@ -20,4 +48,3 @@ DB_PORT=15000
|
|||||||
PUBLIC_IP=127.0.0.1
|
PUBLIC_IP=127.0.0.1
|
||||||
GAME_IMAGE=git.old-metin2.com/metin2/server:nightly
|
GAME_IMAGE=git.old-metin2.com/metin2/server:nightly
|
||||||
GAME_MAX_LEVEL=105
|
GAME_MAX_LEVEL=105
|
||||||
GAME_MALL_URL=metin2.test/mall
|
|
||||||
|
5
assets/db-init/create-databases.sql
Normal file
5
assets/db-init/create-databases.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
CREATE DATABASE account CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
CREATE DATABASE common CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
CREATE DATABASE log CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
CREATE DATABASE player CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
CREATE DATABASE website CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
@ -16,7 +16,8 @@ x-environment:
|
|||||||
|
|
||||||
PUBLIC_IP: ${PUBLIC_IP}
|
PUBLIC_IP: ${PUBLIC_IP}
|
||||||
GAME_MAX_LEVEL: ${GAME_MAX_LEVEL}
|
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:
|
services:
|
||||||
# MySQL Database
|
# MySQL Database
|
||||||
@ -25,15 +26,55 @@ services:
|
|||||||
restart: on-failure
|
restart: on-failure
|
||||||
environment:
|
environment:
|
||||||
# Password for root access
|
# Password for root access
|
||||||
MYSQL_ROOT_PASSWORD: 'metin2'
|
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
|
||||||
ports:
|
ports:
|
||||||
- '${MYSQL_EXTERNAL_PORT}:${MYSQL_PORT}'
|
- '${MYSQL_EXTERNAL_PORT}:${MYSQL_PORT}'
|
||||||
expose:
|
expose:
|
||||||
- ${MYSQL_PORT}
|
- ${MYSQL_PORT}
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage/database/:/var/lib/mysql/
|
- ./storage/database/:/var/lib/mysql/
|
||||||
|
- ./assets/db-init/:/docker-entrypoint-initdb.d/:ro
|
||||||
healthcheck:
|
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
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
@ -51,6 +92,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
web:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
# Auth server
|
# Auth server
|
||||||
auth:
|
auth:
|
||||||
@ -75,6 +118,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
web:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
# Game server (CH1)
|
# Game server (CH1)
|
||||||
ch1_first:
|
ch1_first:
|
||||||
@ -100,6 +145,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
web:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
ch1_game1:
|
ch1_game1:
|
||||||
image: ${GAME_IMAGE}
|
image: ${GAME_IMAGE}
|
||||||
@ -123,6 +170,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
web:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
ch1_game2:
|
ch1_game2:
|
||||||
image: ${GAME_IMAGE}
|
image: ${GAME_IMAGE}
|
||||||
@ -146,6 +195,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
web:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
# Game server (game99)
|
# Game server (game99)
|
||||||
game99:
|
game99:
|
||||||
@ -170,3 +221,5 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
mysql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
web:
|
||||||
|
condition: service_healthy
|
||||||
|
Loading…
Reference in New Issue
Block a user