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