Skip to content

Commit

Permalink
Add PUID and PGID to palworld docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
fryfrog committed Jan 21, 2024
1 parent 941d105 commit 8878780
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

ENV PORT=8211 \
PUID=1000 \
PGID=1000 \
PLAYERS=16 \
MULTITHREADING=false \
COMMUNITY=false \
Expand All @@ -23,4 +25,4 @@ RUN chmod +x /home/steam/server/init.sh /home/steam/server/start.sh
WORKDIR /home/steam/server

EXPOSE ${PORT}
ENTRYPOINT ["/home/steam/server/init.sh"]
ENTRYPOINT ["/home/steam/server/init.sh"]
18 changes: 12 additions & 6 deletions scripts/init.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#!/bin/sh
#!/bin/bash

mkdir -p /palworld
if [[ ! "${PUID}" -eq 0 ]] && [[ ! "${PGID}" -eq 0 ]]; then
echo "Executing usermod..."
usermod -o -u "${PUID}" steam
groupmod -o -g "${PGID}" steam
else
echo "Running as root is not supported, please fix your PUID and PGID!"
exit 1
fi

mkdir -p /palworld
chown -R steam:steam /palworld

if [ "${UPDATE_ON_BOOT}" = true ]; then

printf "\e[0;32m*****STARTING INSTALL/UPDATE*****\e[0m"
/home/steam/steamcmd/steamcmd.sh +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit

su steam -c '/home/steam/steamcmd/steamcmd.sh +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit'
fi

./start.sh
./start.sh
6 changes: 2 additions & 4 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/sh

#!/bin/bash

STARTCOMMAND="./PalServer.sh -port=${PORT} -players=${PLAYERS}"


if [ "${COMMUNITY}" = true ]; then
STARTCOMMAND="${STARTCOMMAND} EpicApp=PalServer"
fi
Expand All @@ -30,7 +28,7 @@ fi

if [ "${MULTITHREADING}" = true ]; then
STARTCOMMAND="${STARTCOMMAND} -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
fi
fi

cd /palworld || exit

Expand Down

0 comments on commit 8878780

Please sign in to comment.