Add an IP bind param to the entrypoint (#447)

* Add an IP bind param to the entrypoint

* Add an example usage to readme

* Rename to BIND
This commit is contained in:
Adam Zahumenský
2022-09-05 11:01:06 +02:00
committed by GitHub
parent 2f28ee6626
commit 5aef1b9f6f
3 changed files with 22 additions and 0 deletions

View File

@ -20,3 +20,4 @@ services:
# - USERNAME=FactorioUsername
# - TOKEN=FactorioToken
# - PORT=34198
# - ADDR=::1

View File

@ -5,6 +5,7 @@ FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
SAVE_NAME="${SAVE_NAME:-""}"
BIND="${BIND:-""}"
mkdir -p "$FACTORIO_VOL"
mkdir -p "$SAVES"
@ -88,6 +89,10 @@ FLAGS=(\
--server-id /factorio/config/server-id.json \
)
if [ -n "$BIND" ]; then
FLAGS+=( --bind "$BIND" )
fi
if [[ $LOAD_LATEST_SAVE == true ]]; then
FLAGS+=( --start-server-load-latest )
else