Skip to content

Commit

Permalink
expose ports
Browse files Browse the repository at this point in the history
  • Loading branch information
Mick Vermeulen authored and Mick Vermeulen committed Sep 12, 2020
1 parent 871731f commit 16519e5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
11 changes: 8 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
1 change: 1 addition & 0 deletions Uchu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
6 changes: 3 additions & 3 deletions config.default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<Networking>
<Certificate />
<Hostname />
<CharacterPort>2002</CharacterPort>
<CharacterPort>$CHARACTER_PORT</CharacterPort>
<HostAuthentication>true</HostAuthentication>
<HostCharacter>true</HostCharacter>
<MaxWorldServers>100</MaxWorldServers>
<MaxWorldServers>$MAX_WORLD_SERVERS</MaxWorldServers>
</Networking>
<GamePlay>
<PathFinding>false</PathFinding>
Expand All @@ -40,7 +40,7 @@
<Api>
<Protocol>http</Protocol>
<Domain>localhost</Domain>
<Port>10000</Port>
<Port>$API_PORT</Port>
</Api>
<Sso>
<Domain />
Expand Down
12 changes: 9 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ services:
env_file:
- .env
restart: always
ports: ["${DATABASE_PORT}:5432"]
ports:
- "${DATABASE_PORT}:5432"
volumes:
- ${DATA_FOLDER}:/var/lib/postgresql/data
adminer:
image: adminer
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:
Expand All @@ -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

0 comments on commit 16519e5

Please sign in to comment.