-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added DEBUG flag for debugging - Added PGID and PUID flags for more control over permissions - Added SKIPUPDATE flag to skip updating the server - Fixed permissions issue (#44) by dropping to `root` - Fixed server settings not persisting (#57) - Split `init.sh` script into `init.sh ` and `run.sh`
- Loading branch information
Showing
4 changed files
with
98 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
FROM cm2network/steamcmd:root | ||
|
||
COPY --chown=steam:steam Game.ini Engine.ini Scalability.ini init.sh /home/steam/ | ||
RUN set -x \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y sudo \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p /config \ | ||
&& chown steam:steam /config | ||
|
||
USER steam | ||
COPY init.sh / | ||
|
||
COPY --chown=steam:steam Game.ini Engine.ini Scalability.ini run.sh /home/steam/ | ||
|
||
WORKDIR /config | ||
|
||
ENV GAMECONFIGDIR="/config/gamefiles/FactoryGame/Saved" \ | ||
ENV DEBUG="false" \ | ||
GAMECONFIGDIR="/config/gamefiles/FactoryGame/Saved" \ | ||
GAMESAVESDIR="/home/steam/.config/Epic/FactoryGame/Saved/SaveGames" \ | ||
MAXPLAYERS="16" \ | ||
PGID="1000" \ | ||
PUID="1000" \ | ||
SKIPUPDATE="false" \ | ||
STEAMAPPID="1690800" \ | ||
STEAMBETA="false" | ||
|
||
EXPOSE 7777/udp 15000/udp 15777/udp | ||
|
||
ENTRYPOINT [ "/home/steam/init.sh" ] | ||
ENTRYPOINT [ "/init.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
NUMCHECK='^[0-9]+$' | ||
|
||
if ! [[ "$MAXPLAYERS" =~ $NUMCHECK ]] ; then | ||
printf "Invalid max players given: ${MAXPLAYERS}\\n" | ||
MAXPLAYERS="16" | ||
fi | ||
|
||
printf "Setting max players to ${MAXPLAYERS}\\n" | ||
sed "s/MaxPlayers\=16/MaxPlayers=$MAXPLAYERS/" -i "/home/steam/Game.ini" | ||
|
||
if [[ "$SKIPUPDATE" == "false" ]]; then | ||
if [[ "$STEAMBETA" == "true" ]]; then | ||
printf "Experimental flag is set. Experimental will be downloaded instead of Early Access.\\n" | ||
STEAMBETAFLAG=" -beta experimental" | ||
fi | ||
|
||
space=$(stat -f --format="%a*%S" .) | ||
space=$((space/1024/1024/1024)) | ||
printf "Checking available space...${space}GB detected\\n" | ||
|
||
if [[ "$space" -lt 5 ]]; then | ||
printf "You have less than 5GB (${space}GB detected) of available space to download the game.\\nIf this is a fresh install, it will probably fail.\\n" | ||
fi | ||
|
||
printf "Downloading the latest version of the game...\\n" | ||
|
||
/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir /config/gamefiles +app_update "$STEAMAPPID$STEAMBETAFLAG" +quit | ||
else | ||
printf "Skipping update as flag is set\\n" | ||
fi | ||
|
||
cp -a /config/saves/. /config/backups/ | ||
cp -a "${GAMESAVESDIR}/server/." /config/backups # useless in first run, but useful in additional runs | ||
rm -rf "${GAMESAVESDIR}/server" | ||
ln -sf /config/saves "${GAMESAVESDIR}/server" | ||
ln -sf /config/ServerSettings.15777 "${GAMESAVESDIR}/ServerSettings.15777" | ||
chmod 755 /config/ServerSettings.15777 | ||
|
||
cp /home/steam/{Engine.ini,Game.ini,Scalability.ini} "${GAMECONFIGDIR}/Config/LinuxServer" | ||
|
||
if [ ! -f "/config/gamefiles/Engine/Binaries/Linux/UE4Server-Linux-Shipping" ]; then | ||
printf "Game binary is missing.\\n" | ||
exit 1 | ||
fi | ||
|
||
cd /config/gamefiles || exit 1 | ||
|
||
Engine/Binaries/Linux/UE4Server-Linux-Shipping FactoryGame -log -NoSteamClient -unattended |