forked from metin2/deploy
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
893d744c5b |
17
.env.example
17
.env.example
@ -5,14 +5,17 @@ GAME_IMAGE=git.old-metin2.com/metin2/server:latest
|
|||||||
WEB_IMAGE=git.old-metin2.com/metin2/web:latest
|
WEB_IMAGE=git.old-metin2.com/metin2/web:latest
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# PostgreSQL settings
|
# MySQL settings
|
||||||
################################################################################
|
################################################################################
|
||||||
POSTGRES_HOST=postgresql
|
MYSQL_HOST=mysql
|
||||||
POSTGRES_USER=server
|
MYSQL_USER=root
|
||||||
POSTGRES_PASSWORD=metin2
|
MYSQL_PASSWORD=metin2
|
||||||
POSTGRES_PORT=5432
|
MYSQL_PORT=3306
|
||||||
POSTGRES_EXTERNAL_PORT=5432
|
MYSQL_EXTERNAL_PORT=3306
|
||||||
POSTGRES_DB=account
|
MYSQL_DB_ACCOUNT=account
|
||||||
|
MYSQL_DB_PLAYER=player
|
||||||
|
MYSQL_DB_COMMON=common
|
||||||
|
MYSQL_DB_LOG=log
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Web app settings
|
# Web app settings
|
||||||
|
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;
|
@ -1,10 +1,9 @@
|
|||||||
x-environment: &common-environment
|
x-environment: &common-environment
|
||||||
POSTGRES_HOST: ${POSTGRES_HOST}
|
MARIADB_HOST: ${MARIADB_HOST}
|
||||||
POSTGRES_USER: ${POSTGRES_USER}
|
MARIADB_USER: ${MARIADB_USER}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
MARIADB_PASSWORD: ${MARIADB_PASSWORD}
|
||||||
POSTGRES_PORT: ${POSTGRES_PORT}
|
MARIADB_PORT: ${MARIADB_PORT}
|
||||||
POSTGRES_EXTERNAL_PORT: ${POSTGRES_EXTERNAL_PORT}
|
MARIADB_DB: ${MARIADB_DB}
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
|
||||||
|
|
||||||
TEST_SERVER: ${TEST_SERVER}
|
TEST_SERVER: ${TEST_SERVER}
|
||||||
|
|
||||||
@ -16,24 +15,64 @@ x-environment: &common-environment
|
|||||||
WEB_APP_URL: ${WEB_APP_URL}
|
WEB_APP_URL: ${WEB_APP_URL}
|
||||||
WEB_APP_KEY: ${WEB_APP_KEY}
|
WEB_APP_KEY: ${WEB_APP_KEY}
|
||||||
|
|
||||||
|
name: Metin2
|
||||||
|
|
||||||
services:
|
services:
|
||||||
# PostgreSQL Database
|
# MySQL Database
|
||||||
postgresql:
|
mysql:
|
||||||
image: postgresql:16
|
image: mariadb:lts
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
# Password for root access
|
# Password for root access
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
MARIADB_ROOT_PASSWORD: ${MARIADB_PASSWORD}
|
||||||
POSTGRES_USER: ${POSTGRES_USER}
|
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
||||||
ports:
|
ports:
|
||||||
- "${POSTGRES_EXTERNAL_PORT}:${POSTGRES_PORT}"
|
- "${MARIADB_EXTERNAL_PORT}:${MARIADB_PORT}"
|
||||||
expose:
|
expose:
|
||||||
- ${POSTGRES_PORT}
|
- ${MARIADB_PORT}
|
||||||
volumes:
|
volumes:
|
||||||
- ./storage/database/:/var/lib/postgresql/data/
|
- ./storage/database/:/var/lib/mysql/
|
||||||
|
- ./assets/db-init/:/docker-entrypoint-initdb.d/:ro
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: pg_isready -d $POSTGRES_DB
|
test: mysqladmin ping -h localhost -u root -p$$MARIADB_ROOT_PASSWORD
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
# 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_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:
|
||||||
|
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
|
||||||
@ -49,7 +88,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./storage/log/db/:/app/log/
|
- ./storage/log/db/:/app/log/
|
||||||
depends_on:
|
depends_on:
|
||||||
postgresql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
# Auth server
|
# Auth server
|
||||||
@ -58,6 +97,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
<<: *common-environment
|
<<: *common-environment
|
||||||
|
MARIADB_DB: ${MARIADB_DB}
|
||||||
GAME_HOSTNAME: auth
|
GAME_HOSTNAME: auth
|
||||||
GAME_CHANNEL: 1
|
GAME_CHANNEL: 1
|
||||||
GAME_AUTH_SERVER: master
|
GAME_AUTH_SERVER: master
|
||||||
@ -72,7 +112,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./storage/log/auth/:/app/log/
|
- ./storage/log/auth/:/app/log/
|
||||||
depends_on:
|
depends_on:
|
||||||
postgresql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
# Game server (CH1)
|
# Game server (CH1)
|
||||||
@ -97,7 +137,7 @@ services:
|
|||||||
- ./storage/log/ch1/first/:/app/log/
|
- ./storage/log/ch1/first/:/app/log/
|
||||||
- ./storage/mark/:/app/mark/
|
- ./storage/mark/:/app/mark/
|
||||||
depends_on:
|
depends_on:
|
||||||
postgresql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
ch1_game1:
|
ch1_game1:
|
||||||
@ -120,7 +160,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./storage/log/ch1/game1/:/app/log/
|
- ./storage/log/ch1/game1/:/app/log/
|
||||||
depends_on:
|
depends_on:
|
||||||
postgresql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
ch1_game2:
|
ch1_game2:
|
||||||
@ -143,7 +183,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./storage/log/ch1/game2/:/app/log/
|
- ./storage/log/ch1/game2/:/app/log/
|
||||||
depends_on:
|
depends_on:
|
||||||
postgresql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
# Game server (game99)
|
# Game server (game99)
|
||||||
@ -167,5 +207,5 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./storage/log/game99/:/app/log/
|
- ./storage/log/game99/:/app/log/
|
||||||
depends_on:
|
depends_on:
|
||||||
postgresql:
|
mysql:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
Reference in New Issue
Block a user