fix: improve our docker config (#1373)

* greatly simplify docker

* back to gcc since I can't the libs to load properly

* fix typo
add set -e to entrypoint
better copy of entrypoint.sh and use proper entrypoint

* use debian instead of gcc for runtime
comment and organize it a bit
drop gcc to 12 since we are using debian 12 as well

* explicitly include mariadb libs

* Make the server not crash in the case we are using only env-vars
make the dockerfile have configs in the expected location incase of bypassing entrypoint.sh

* remove unneede var from example, since it's in the container now

* coments to dockerfile

* Revert master server changes

* Resolve conflicting port options between chat, master, and world
move chat_server_port to shared since it's used by world and chat

* Don't error if file does not exists when updating a config option
move update before and use bin dir var
This commit is contained in:
Aaron Kimbrell
2024-01-03 02:36:17 -06:00
committed by GitHub
parent a84ca1f00d
commit 9116317834
38 changed files with 204 additions and 360 deletions

View File

@@ -1,104 +1,66 @@
version: "3"
services:
setup:
container_name: DarkflameSetup
build:
context: .
dockerfile: ./docker/setup.Dockerfile
environment:
- DATABASE=${MARIADB_DATABASE:-darkflame}
- DATABASE_HOST=database
- DATABASE_USER=${MARIADB_USER:-darkflame}
- DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame}
- EXTERNAL_IP=${EXTERNAL_IP:-darkflame}
- BUILD_VERSION=${BUILD_VERSION:?171022}
volumes:
- ${CLIENT_PATH:?missing_client_path}:/client
- shared_configs:/docker/
database:
container_name: DarkflameDatabase
build:
context: .
dockerfile: ./docker/database.Dockerfile
darkflamedb:
image: mariadb:latest
environment:
- MARIADB_USER=${MARIADB_USER:-darkflame}
- MARIADB_PASSWORD=${MARIADB_PASSWORD:-darkflame}
- MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-darkflame}
- MARIADB_DATABASE=${MARIADB_DATABASE:-darkflame}
volumes:
- database:/var/lib/mysql
networks:
- darkflame
# You can expose these so that DB management tools can connect (WARNING: INSECURE)
# ports:
# - 3306:3306
darkflame:
container_name: DarkflameServer
darkfameserver:
networks:
- darkflame
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- BUILD_THREADS=${BUILD_THREADS:-1}
- BUILD_VERSION=${BUILD_VERSION:-171022}
image: ghcr.io/darkflameuniverse/darkflameserver:latest
volumes:
- ${CLIENT_PATH:?missing_client_path}:/client:ro
- shared_configs:/shared_configs:ro
- $HOST_CONFIG_DIR:/app/configs/
- $HOST_CLIENT_LOCATION:$CLIENT_LOCATION:ro
- $HOST_RESSERVER_LOCATION:/app/resServer/
- $HOST_DUMP_FOLDER:$DUMP_FOLDER
- $HOST_LOGS_DIR:/app/logs/
environment:
- DLU_CONFIG_DIR=/app/configs
- MYSQL_HOST=darkflamedb
- MYSQL_DATABASE=${MARIADB_DATABASE:-darkflame}
- MYSQL_USERNAME=${MARIADB_USER:-darkflame}
- MYSQL_PASSWORD=${MARIADB_PASSWORD:-darkflame}
- EXTERNAL_IP=${EXTERNAL_IP:-localhost}
- DUMP_FOLDER=$DUMP_FOLDER
- CLIENT_LOCATION=$CLIENT_LOCATION
depends_on:
- database
- darkflamedb
ports:
- "1001:1001/udp"
- "2000:2000/udp"
- "2005:2005/udp"
- "3000-3300:3000-3300/udp"
brickbuildfix:
container_name: DarkflameBrickBuildFix
darkflameweb:
networks:
- darkflame
build:
context: .
dockerfile: ./docker/brickfix.Dockerfile
ports:
- 80:80
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 2m
timeout: 3s
retries: 3
start_period: 40s
account-manager:
container_name: DarkflameAccountManager
networks:
- darkflame
build:
context: .
dockerfile: ./docker/AccountManager.Dockerfile
image: ghcr.io/darkflameuniverse/nexusdashboard:latest
volumes:
- $HOST_CLIENT_LOCATION:/app/luclient:ro
- $HOST_CACHE_LOCATION:/app/cache
- $HOST_CD_SQLITE_LOCATION:/app/cdclient:ro
environment:
- DATABASE=${MARIADB_DATABASE:-darkflame}
- DATABASE_HOST=database
- DATABASE_USER=${MARIADB_USER:-darkflame}
- DATABASE_PASSWORD=${MARIADB_PASSWORD:-darkflame}
- ACCOUNT_SECRET=${ACCOUNT_MANAGER_SECRET:?missing_account_secret}
- APP_SECRET_KEY=$APP_SECRET_KEY
- APP_DATABASE_URI=mysql+pymysql://${MARIADB_USER:-darkflame}:${MARIADB_PASSWORD:-darkflame}@darkflamedb:3306/${MARIADB_DATABASE:-darkflame}
- CLIENT_LOCATION=/app/luclient
- CACHE_LOCATION=/app/cache
- CD_SQLITE_LOCATION=/app/cdclient
depends_on:
- darkflamedb
ports:
- 5000:5000
- 8000:8000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000"]
test: ["CMD", "curl", "-f", "http://localhost:8000"]
interval: 2m
timeout: 3s
retries: 3
start_period: 40s
depends_on:
- database
networks:
darkflame:
volumes:
database:
shared_configs: