mirror of https://github.com/cocosolos/lsd.git
107 lines
2.6 KiB
YAML
107 lines
2.6 KiB
YAML
x-common: &common # Configs used by more than one service.
|
|
image: lsd_service:ubuntu
|
|
pull_policy: never
|
|
environment:
|
|
XI_NETWORK_HTTP_HOST: 0.0.0.0
|
|
XI_NETWORK_ZMQ_IP: world
|
|
XI_NETWORK_SQL_HOST: database
|
|
volumes:
|
|
- ./.git:/.git
|
|
- ./config:/config
|
|
- ./server/.git:/server/.git
|
|
- ./server/log:/server/log
|
|
- ./server/losmeshes:/server/losmeshes
|
|
- ./server/modules:/server/modules
|
|
- ./server/navmeshes:/server/navmeshes
|
|
- ./server/scripts:/server/scripts
|
|
- ./server/settings:/server/settings
|
|
- ./server/sql:/server/sql
|
|
- ./server/tools:/server/tools
|
|
|
|
services:
|
|
database:
|
|
image: mariadb
|
|
entrypoint: ["/mariadb-entrypoint.sh"]
|
|
command: ["mariadbd"]
|
|
restart: always
|
|
volumes:
|
|
- ./config:/config
|
|
- ./mariadb-entrypoint.sh:/mariadb-entrypoint.sh # Custom entrypoint to generate .env.
|
|
- database:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
|
start_period: 10s
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
dbtool:
|
|
<<: *common # Import common configs.
|
|
build:
|
|
context: .
|
|
dockerfile: docker/ubuntu.Dockerfile # This service builds the image shared by all LSB services.
|
|
command: ["python3", "/server/tools/dbtool.py", "update"]
|
|
restart: no
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
|
|
connect:
|
|
<<: *common
|
|
command: ["/server/xi_connect"]
|
|
restart: unless-stopped
|
|
ports:
|
|
- "54001:54001"
|
|
- "54230:54230"
|
|
- "54231:54231"
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
restart: true
|
|
dbtool:
|
|
condition: service_completed_successfully
|
|
|
|
search:
|
|
<<: *common
|
|
command: ["/server/xi_search"]
|
|
restart: unless-stopped
|
|
ports:
|
|
- "54002:54002"
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
restart: true
|
|
dbtool:
|
|
condition: service_completed_successfully
|
|
|
|
world:
|
|
<<: *common
|
|
command: ["/server/xi_world"]
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8088:8088"
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
restart: true
|
|
dbtool:
|
|
condition: service_completed_successfully
|
|
|
|
map:
|
|
<<: *common
|
|
command: ["/server/xi_map"]
|
|
restart: unless-stopped
|
|
ports:
|
|
- "54230:54230/udp"
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
restart: true
|
|
dbtool:
|
|
condition: service_completed_successfully
|
|
world:
|
|
condition: service_started
|
|
|
|
volumes:
|
|
database:
|