diff --git a/docker-compose.yml b/docker-compose.yml index 519fcce3..eb7bb8a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,11 +14,13 @@ services: - EXTERNAL_IP=${EXTERNAL_IP:-darkflame} volumes: - ${CLIENT_PATH:?err}:/client - - ./docker/:/docker/ + - shared_configs:/docker/ database: container_name: DarkflameDatabase - image: mariadb:10.6 + build: + context: . + dockerfile: ./docker/database.Dockerfile environment: - MARIADB_USER=${MARIADB_USER:-darkflame} - MARIADB_PASSWORD=${MARIADB_PASSWORD:-darkflame} @@ -26,7 +28,6 @@ services: - MARIADB_DATABASE=${MARIADB_DATABASE:-darkflame} volumes: - database:/var/lib/mysql - - ./migrations/dlu:/docker-entrypoint-initdb.d networks: - darkflame ports: @@ -44,7 +45,7 @@ services: - BUILD_VERSION=${BUILD_VERSION:-171022} volumes: - ${CLIENT_PATH:?err}:/client - - ./docker/configs/:/configs + - shared_configs:/shared_configs depends_on: - database ports: @@ -98,3 +99,4 @@ networks: volumes: database: + shared_configs: diff --git a/docker/database.Dockerfile b/docker/database.Dockerfile new file mode 100644 index 00000000..68261e44 --- /dev/null +++ b/docker/database.Dockerfile @@ -0,0 +1,3 @@ +FROM mariadb:10.6 + +COPY ./migrations/dlu /docker-entrypoint-initdb.d \ No newline at end of file diff --git a/docker/start_server.sh b/docker/start_server.sh index 9a2345c6..825d5014 100755 --- a/docker/start_server.sh +++ b/docker/start_server.sh @@ -21,10 +21,10 @@ function symlink_client_files() { function symlink_config_files() { echo "Creating symlinks for config files" rm /app/*.ini - ln -s /configs/authconfig.ini /app/authconfig.ini - ln -s /configs/chatconfig.ini /app/chatconfig.ini - ln -s /configs/masterconfig.ini /app/masterconfig.ini - ln -s /configs/worldconfig.ini /app/worldconfig.ini + ln -s /shared_configs/configs/authconfig.ini /app/authconfig.ini + ln -s /shared_configs/configs/chatconfig.ini /app/chatconfig.ini + ln -s /shared_configs/configs/masterconfig.ini /app/masterconfig.ini + ln -s /shared_configs/configs/worldconfig.ini /app/worldconfig.ini } if [[ ! -f "/app/initialized" ]]; then @@ -37,6 +37,11 @@ else echo "Server already initialized" fi +while [ ! -f "/client/migrated" ]; do + echo "Client setup not finished. Waiting for setup container to complete" + sleep 1 +done + # start the server echo "Start MasterServer" ./MasterServer