diff --git a/Dockerfile b/Dockerfile index 616ec6a..9d89be9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,8 @@ ENV HOME=/home/steam \ GAME_PORT=7777 \ RELIABLE_PORT=7778 \ SERVER_IP=0.0.0.0 \ - GENERATE_SETTINGS=true + GENERATE_SETTINGS=true \ + BRANCH=public COPY ./scripts /home/steam/server/ diff --git a/README.md b/README.md index 48ac687..cc25834 100644 --- a/README.md +++ b/README.md @@ -86,15 +86,27 @@ docker run -d \ -p 7777:7777/udp \ -p 7777:7777/tcp \ -p 7778:7778/tcp \ + -e PUID=1000 \ + -e PGID=1000 \ -e GENERATE_SETTINGS=true \ + -e BRANCH=public \ --env-file .env \ -v ./satisfactory/server-files:/satisfactory \ - -v ./satisfactory/server-data:/home/steam/.config/Epic/FactoryGame/Saved/SaveGames + -v ./satisfactory/server-data:/home/steam/.config/Epic/FactoryGame/Saved/SaveGames \ indifferentbroccoli/satisfactory-server-docker ``` ## Environment Variables +### Container settings + +| Variable | Default | Description | +|---------------------|----------|---------------------------------------------------------------------------------| +| `PUID` | Required | User ID to run the server as | +| `PGID` | Required | Group ID to run the server as | +| `GENERATE_SETTINGS` | `true` | Generate settings from environment variables | +| `BRANCH` | `public` | Steam branch to install (`public` for stable or `experimental` for experimental) | + ### Server settings | Variable | Default | Description | diff --git a/scripts/functions.sh b/scripts/functions.sh index 1c50dfa..3accabc 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -41,7 +41,9 @@ Log() { install() { LogAction "Starting server install" - /home/steam/steamcmd/steamcmd.sh +runscript /home/steam/server/install.scmd + LogInfo "Installing branch: ${BRANCH}" + envsubst < /home/steam/server/install.scmd > /tmp/install.scmd + /home/steam/steamcmd/steamcmd.sh +runscript /tmp/install.scmd } cpu_check(){ diff --git a/scripts/install.scmd b/scripts/install.scmd index 578a9ef..34ec89a 100644 --- a/scripts/install.scmd +++ b/scripts/install.scmd @@ -1,5 +1,5 @@ -// Do not shutdown on a failed command -@ShutdownOnFailedCommand 0 +// Shutdown on a failed command so restart policy can pick it up +@ShutdownOnFailedCommand 1 //No password as this is unattended @NoPromptForPassword 1 @@ -10,6 +10,6 @@ force_install_dir /satisfactory login anonymous // Install/Update the Satisfactory Dedicated Server -app_update 1690800 validate +app_update 1690800 -beta ${BRANCH} validate quit \ No newline at end of file