mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Allow custom game ports other than 12203 to be specified through GAME_PORT environment variable
This commit is contained in:
parent
1be50cdddf
commit
6b36bec8e9
3 changed files with 11 additions and 2 deletions
|
@ -37,5 +37,9 @@ HEALTHCHECK --interval=15s --timeout=20s --start-period=10s --retries=3 CMD [ "b
|
|||
RUN useradd -m openmohaa
|
||||
USER openmohaa
|
||||
|
||||
ENV GAME_PORT=12203
|
||||
|
||||
COPY "entrypoint.sh" "/usr/local/bin/entrypoint.sh"
|
||||
WORKDIR "/usr/local/share/mohaa"
|
||||
ENTRYPOINT [ "/usr/local/games/openmohaa/lib/openmohaa/omohaaded", "+set", "fs_homepath", "home" ]
|
||||
|
||||
ENTRYPOINT [ "bash", "entrypoint.sh" ]
|
||||
|
|
5
docker/server/base/entrypoint.sh
Normal file
5
docker/server/base/entrypoint.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# It's amazing that with Docker, one can't put environment variables in the array of the ENTRYPOINT command
|
||||
|
||||
/usr/local/games/openmohaa/lib/openmohaa/omohaaded +set fs_homepath home +set dedicated 2 +set net_port $GAME_PORT:-12203 $@
|
|
@ -6,7 +6,7 @@ header=$'\xff\xff\xff\xff\x01disconnect'
|
|||
# so the server will return the disconnect message
|
||||
message=$'none'
|
||||
|
||||
query_port=12203
|
||||
query_port=${GAME_PORT:-12203}
|
||||
data=""
|
||||
|
||||
while [ -z "$data" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue