name: Metin2 services: # Database database: image: ${DB_IMAGE} restart: always environment: POSTGRES_USER: ${DATABASE_USER:-root} POSTGRES_DB: ${DATABASE_DB:-metin2} POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-rootpassword} REDIS_HOST: ${REDIS_HOST:-redis} REDIS_PASSWORD: ${REDIS_PASSWORD} ports: - "${DATABASE_EXTERNAL_PORT:-5432}:${DATABASE_PORT:-5432}" expose: - "${DATABASE_PORT:-5432}" volumes: - ./storage/database:/var/lib/postgresql - ./assets/postgres/db-init:/docker-entrypoint-initdb.d:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DATABASE_USER:-root}"] interval: 10s timeout: 5s retries: 5 networks: - metin2 depends_on: redis: condition: service_healthy pgbouncer: image: docker.io/bitnamilegacy/pgbouncer:latest restart: always environment: POSTGRESQL_HOST: database POSTGRESQL_PORT: ${DATABASE_PORT:-5432} POSTGRESQL_USERNAME: ${DATABASE_USER:-root} POSTGRESQL_PASSWORD: ${DATABASE_PASSWORD:-rootpassword} POSTGRESQL_DATABASE: ${DATABASE_DB:-metin2} PGBOUNCER_DATABASE: ${DATABASE_DB:-metin2} PGBOUNCER_PORT: 6432 PGBOUNCER_POOL_MODE: transaction PGBOUNCER_MAX_CLIENT_CONN: 500 PGBOUNCER_DEFAULT_POOL_SIZE: 20 PGBOUNCER_MIN_POOL_SIZE: 5 PGBOUNCER_RESERVE_POOL_SIZE: 3 PGBOUNCER_MAX_DB_CONNECTIONS: 50 PGBOUNCER_QUERY_TIMEOUT: 30 PGBOUNCER_IDLE_TRANSACTION_TIMEOUT: 60 PGBOUNCER_SERVER_IDLE_TIMEOUT: 600 PGBOUNCER_STATS_USERS: ${DATABASE_USER:-root} PGBOUNCER_IGNORE_STARTUP_PARAMETERS: extra_float_digits ports: - "${PGBOUNCER_EXTERNAL_PORT:-6432}:6432" expose: - "6432" depends_on: database: condition: service_healthy networks: - metin2 redis: image: redis:7 restart: always ports: - "${REDIS_EXTERNAL_PORT:-6379}:6379" command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"] environment: - REDIS_PASSWORD=${REDIS_PASSWORD} volumes: - ./storage/redis:/data healthcheck: test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"] interval: 10s timeout: 5s retries: 5 networks: - metin2 # DBCache Server db: image: ${GAME_IMAGE} restart: always env_file: - .env expose: - ${DB_PORT} command: db volumes: - ./storage/log/db/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 # Auth server auth: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: auth GAME_CHANNEL: 1 GAME_AUTH_SERVER: master GAME_PORT: 11000 GAME_P2P_PORT: 12000 env_file: - .env expose: - 11000 - 12000 ports: - "11000:11000" command: game volumes: - ./storage/log/auth/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 # Game server (CH1) ch1_first: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: ch1_first GAME_CHANNEL: 1 GAME_MARK_SERVER: true 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 env_file: - .env expose: - 13000 - 14000 ports: - "13000:13000" command: game volumes: - ./storage/log/ch1/first/:/app/log/ - ./storage/mark/:/app/mark/ depends_on: database: condition: service_healthy networks: - metin2 ch1_game1: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: ch1_game1 GAME_CHANNEL: 1 GAME_MARK_SERVER: false GAME_PORT: 13001 GAME_P2P_PORT: 14001 GAME_MAP_ALLOW: 61 62 67 68 72 73 208 351 352 356 env_file: - .env expose: - 13001 - 14001 ports: - "13001:13001" command: game volumes: - ./storage/log/ch1/game1/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 ch1_game2: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: ch1_game2 GAME_CHANNEL: 1 GAME_MARK_SERVER: false GAME_PORT: 13002 GAME_P2P_PORT: 14002 GAME_MAP_ALLOW: 63 64 65 66 69 70 71 104 108 109 216 217 env_file: - .env expose: - 13002 - 14002 ports: - "13002:13002" command: game volumes: - ./storage/log/ch1/game2/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 ch1_game3: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: ch1_game3 GAME_CHANNEL: 1 GAME_MARK_SERVER: false GAME_PORT: 13003 GAME_P2P_PORT: 14003 GAME_MAP_ALLOW: 301 302 303 304 353 354 358 359 378 379 380 381 env_file: - .env expose: - 13003 - 14003 ports: - "13003:13003" command: game volumes: - ./storage/log/ch1/game3/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 ch1_game4: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: ch1_game4 GAME_CHANNEL: 1 GAME_MARK_SERVER: false 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 env_file: - .env expose: - 13004 - 14004 ports: - "13004:13004" command: game volumes: - ./storage/log/ch1/game4/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 ch1_game5: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: ch1_game5 GAME_CHANNEL: 1 GAME_MARK_SERVER: false 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 env_file: - .env expose: - 13005 - 14005 ports: - "13005:13005" command: game volumes: - ./storage/log/ch1/game5/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 # Game server (game99) game99: image: ${GAME_IMAGE} restart: always environment: GAME_HOSTNAME: game99 GAME_CHANNEL: 99 GAME_MARK_SERVER: false 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 env_file: - .env expose: - 13099 - 14099 ports: - "13099:13099" command: game volumes: - ./storage/log/game99/:/app/log/ depends_on: database: condition: service_healthy networks: - metin2 networks: metin2: name: metin2-network