From 16519e52e03ceaabf14cb35e87faadafe64307c9 Mon Sep 17 00:00:00 2001 From: Mick Vermeulen Date: Sat, 12 Sep 2020 14:08:28 +0200 Subject: [PATCH] expose ports --- .env.sample | 11 ++++++++--- Uchu.Dockerfile | 1 + config.default.xml | 6 +++--- docker-compose.yaml | 12 +++++++++--- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.env.sample b/.env.sample index e5f8548..68fa565 100644 --- a/.env.sample +++ b/.env.sample @@ -3,11 +3,16 @@ DATABASE_PORT=5432 REDIS_PORT=6379 ADMINER_PORT=8080 DATA_FOLDER=./data - -# Change this to your local game folder GAME_FOLDER=/res # Postgres specific setup POSTGRES_USER=uchu POSTGRES_PASSWORD=uchu -POSTGRES_DB=uchu \ No newline at end of file +POSTGRES_DB=uchu + +# Uchu specific setup +CHARACTER_PORT=2002 +API_PORT=10000 +MAX_WORLD_SERVERS=100 +# Should be API_PORT + MAX_WORLD_SERVERS +MAX_API_PORT=10100 \ No newline at end of file diff --git a/Uchu.Dockerfile b/Uchu.Dockerfile index fbbdf63..625afb2 100644 --- a/Uchu.Dockerfile +++ b/Uchu.Dockerfile @@ -3,6 +3,7 @@ COPY Uchu config.default.xml .env ./ RUN apk add gettext RUN set -o allexport && source .env && set +o allexport && envsubst < config.default.xml > config.xml +RUN cat config.xml RUN dotnet build ENTRYPOINT ["dotnet", "Uchu.Master/bin/Debug/netcoreapp3.1/Uchu.Master.dll"] \ No newline at end of file diff --git a/config.default.xml b/config.default.xml index f810d98..b1d3ae7 100644 --- a/config.default.xml +++ b/config.default.xml @@ -28,10 +28,10 @@ - 2002 + $CHARACTER_PORT true true - 100 + $MAX_WORLD_SERVERS false @@ -40,7 +40,7 @@ http localhost - 10000 + $API_PORT diff --git a/docker-compose.yaml b/docker-compose.yaml index bc4c292..2f8785b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,7 +5,8 @@ services: env_file: - .env restart: always - ports: ["${DATABASE_PORT}:5432"] + ports: + - "${DATABASE_PORT}:5432" volumes: - ${DATA_FOLDER}:/var/lib/postgresql/data adminer: @@ -13,13 +14,15 @@ services: restart: always depends_on: - db - ports: ["${ADMINER_PORT}:8080"] + ports: + - "${ADMINER_PORT}:8080" redis: image: redis:6.0.8-alpine env_file: - .env restart: always - ports: ["${REDIS_PORT}:6379"] + ports: + - "${REDIS_PORT}:6379" volumes: - ${DATA_FOLDER}:/data uchu: @@ -33,5 +36,8 @@ services: - .env volumes: - ${GAME_FOLDER}:/res + ports: + - "2002:${CHARACTER_PORT}" + - "10000-10100:${API_PORT}-${MAX_API_PORT}" tty: true stdin_open: true