Update satisfactory image

This commit is contained in:
Matthew Penner 2021-04-29 13:11:50 -06:00
parent 33142755fd
commit b76eab6921
2 changed files with 37 additions and 10 deletions

View file

@ -20,7 +20,7 @@
# SOFTWARE. # SOFTWARE.
# #
FROM --platform=$BUILDPLATFORM debian:stable-slim FROM debian:stable-slim
LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io" LABEL author="Matthew Penner" maintainer="matthew@pterodactyl.io"
@ -42,7 +42,7 @@ RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key \
&& wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/amd64/libfaudio0_20.01-0~buster_amd64.deb \ && wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/amd64/libfaudio0_20.01-0~buster_amd64.deb \
&& wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/i386/libfaudio0_20.01-0~buster_i386.deb \ && wget -nc https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/i386/libfaudio0_20.01-0~buster_i386.deb \
&& apt install -y ./libfaudio0_20.01-0~buster_* \ && apt install -y ./libfaudio0_20.01-0~buster_* \
&& apt install -y --install-recommends winehq-stable cabextract xvfb && apt install -y --install-recommends winehq-stable cabextract
USER container USER container
ENV USER=container HOME=/home/container ENV USER=container HOME=/home/container

View file

@ -22,20 +22,47 @@
# SOFTWARE. # SOFTWARE.
# #
# Default the TZ environment variable to UTC. # Default the TZ environment variable to UTC
TZ=${TZ:-UTC} TZ=${TZ:-UTC}
export TZ export TZ
# Set the GAMECONFIGDIR environment variable
GAMECONFIGDIR="/home/container/.wine/drive_c/users/container/Local Settings/Application Data/FactoryGame/Saved"
export GAMECONFIGDIR
# Switch to the container's working directory # Switch to the container's working directory
cd /home/container cd /home/container
# Set environment variable that holds the Internal Docker IP # Create required directories
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` mkdir -p /home/container/config /home/container/gamefiles /home/container/saves "$GAMECONFIGDIR/Config/WindowsNoEditor" "$GAMECONFIGDIR/Logs" "$GAMECONFIGDIR/SaveGames/common"
# Replace variables in the startup command # Touch the log file
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` touch "$GAMECONFIGDIR/Logs/FactoryGame.log"
# Copy config files
cp /home/container/config/{Engine.ini,Game.ini,Scalability.ini} "$GAMECONFIGDIR/Config/WindowsNoEditor/"
# Copy save files
cp -rp /home/container/saves/*.sav "$GAMECONFIGDIR/SaveGames/common/"
# Get the latest save file
LATEST_SAVE_FILE=$(ls -Art "$GAMECONFIGDIR/SaveGames/common" | tail -n 1)
# Move latest save file
if [[ ! "$LATEST_SAVE_FILE" == "savefile.sav" ]]; then
printf "\\nMoving most recent save (%s) to savefile.sav\\n" "$LATEST_SAVE_FILE"
mv "$GAMECONFIGDIR/SaveGames/common/$LATEST_SAVE_FILE" "$GAMECONFIGDIR/SaveGames/common/savefile.sav"
fi
# Switch to the gamefiles directory
cd /home/container/gamefiles
# Start Satisfactory (runs in the background)
printf '\033[1m\033[33mcontainer@pterodactyl~ \033[0m' printf '\033[1m\033[33mcontainer@pterodactyl~ \033[0m'
echo "${MODIFIED_STARTUP}" echo "wine start FactoryGame.exe -nosteamclient -nullrhi -nosplash -nosound"
wine start FactoryGame.exe -nosteamclient -nullrhi -nosplash -nosound
# Run the startup command # Tail the satisfactory log file
exec env ${MODIFIED_STARTUP} printf '\033[1m\033[33mcontainer@pterodactyl~ \033[0m'
echo "tail -f \"$GAMECONFIGDIR/Logs/FactoryGame.log\""
tail -f "$GAMECONFIGDIR/Logs/FactoryGame.log"