Compare commits
45 Commits
Author | SHA1 | Date | |
---|---|---|---|
6f8db928de | |||
1a6290534c | |||
68152ca356 | |||
db74d62640 | |||
0d0f16b9cc | |||
1f4c77e2d0 | |||
43e697ea9b | |||
d5dbbde762 | |||
f38604010f | |||
1bead6d59b | |||
e75fa0af14 | |||
03db5b8785 | |||
2696215232 | |||
f442dfe4f6 | |||
4b531c2cc9 | |||
1951012725 | |||
1c9ea06ec5 | |||
ab2899c6ce | |||
321205c261 | |||
b70687dbfe | |||
63e5bb9d39 | |||
4a0f6972eb | |||
ab03da94fe | |||
f1455aabdb | |||
375f3a3033 | |||
0a5ddca86d | |||
d8faaeb7c2 | |||
432361e9f6 | |||
4eb0e756a4 | |||
4c58d85d62 | |||
28cbbc2a11 | |||
ab34a63ee0 | |||
9f98c1762b | |||
13e3f609fd | |||
7ff2252eb0 | |||
8282595cf4 | |||
6ccdd30710 | |||
b33fe0ccbf | |||
a229e2df13 | |||
50b9b92696 | |||
2d3449d935 | |||
6a709a9621 | |||
cb70a23534 | |||
b22d9ed7de | |||
d55dcde29d |
15
Dockerfile
15
Dockerfile
@@ -1,19 +1,22 @@
|
||||
FROM ich777/debian-baseimage:bullseye_amd64
|
||||
FROM ich777/debian-baseimage
|
||||
|
||||
LABEL org.opencontainers.image.authors="admin@minenet.at"
|
||||
LABEL org.opencontainers.image.source="https://github.com/ich777/docker-steamcmd-server"
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 lib32z1 && \
|
||||
apt-get -y install --no-install-recommends lib32gcc-s1 lib32stdc++6 xdg-user-dirs && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV DATA_DIR="/serverdata"
|
||||
ENV STEAMCMD_DIR="${DATA_DIR}/steamcmd"
|
||||
ENV SERVER_DIR="${DATA_DIR}/serverfiles"
|
||||
ENV GAME_ID="template"
|
||||
ENV GAME_NAME="template"
|
||||
ENV GAME_PARAMS="template"
|
||||
ENV GAME_PORT=27015
|
||||
ENV GAME_ID="2394010"
|
||||
ENV GAME_PARAMS="EpicApp=PalServer"
|
||||
ENV GAME_PARAMS_EXTRA="-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
|
||||
ENV UPDATE_PUBLIC_IP="false"
|
||||
ENV BACKUP="false"
|
||||
ENV BACKUP_INTERVAL=120
|
||||
ENV BACKUPS_TO_KEEP=12
|
||||
ENV VALIDATE=""
|
||||
ENV UMASK=000
|
||||
ENV UID=99
|
||||
|
49
README.md
49
README.md
@@ -1,36 +1,53 @@
|
||||
# SteamCMD in Docker optimized for Unraid
|
||||
This Docker will download and install SteamCMD and the according game that is pulled via specifying the Tag.
|
||||
This Docker will download and install SteamCMD. It will also install Palworld and run it.
|
||||
|
||||
**Please see the different Tags/Branches which games are available.**
|
||||
**Server Name:** Palworld Docker
|
||||
**Password:** Docker
|
||||
**Admin Password:** adminDocker
|
||||
|
||||
## Example Env params for CS:Source
|
||||
**Configuration:** The configuration is located at: .../Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
|
||||
|
||||
ATTENTION: First Startup can take very long since it downloads the gameserver files!
|
||||
|
||||
Update Notice: Simply restart the container if a newer version of the game is available.
|
||||
|
||||
You can also run multiple servers with only one SteamCMD directory!
|
||||
|
||||
## Example Env params
|
||||
| Name | Value | Example |
|
||||
| --- | --- | --- |
|
||||
| STEAMCMD_DIR | Folder for SteamCMD | /serverdata/steamcmd |
|
||||
| SERVER_DIR | Folder for gamefile | /serverdata/serverfiles |
|
||||
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '232330 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 232330 |
|
||||
| GAME_NAME | SRCDS gamename | cstrike |
|
||||
| GAME_PARAMS | Values to start the server | -secure +maxplayers 32 +map de_dust2 |
|
||||
| GAME_ID | The GAME_ID that the container downloads at startup. If you want to install a static or beta version of the game change the value to: '2394010 -beta YOURBRANCH' (without quotes, replace YOURBRANCH with the branch or version you want to install). | 2394010 |
|
||||
| SRV_ADMIN_PWD | Your server admin password goes here | adminDocker |
|
||||
| GAME_PARAMS | Enter your game parameters (for a community server put in the value '-publiclobby' without quotes) | -publiclobby -rconport=25575 |
|
||||
| GAME_PARAMS_EXTRA | Enter your Extra Game Parameters seperated with a space and - (eg: -No-useperfthreads -NoAsyncLoadingThread) | -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS |
|
||||
| UPDATE_PUBLIC_IP | If set to 'true' the container will check on each container start if the Public IP is still valid (the container will try to grab your public IP on the first server start since the public IP is necessary to run a community server). | false |
|
||||
| BACKUP | Set this value to 'true' to enable the automated backup function from the container, you find the Backups in '.../palworld/Backups/'. Set to 'false' to disable the backup function. | true |
|
||||
| BACKUP_INTERVAL | The backup interval in minutes (ATTENTION: The first backup will be triggered after the set interval in this variable after the start/restart of the container) | 120 |
|
||||
| BACKUPS_TO_KEEP | Number of backups to keep (by default set to 12 to keep the last backups of the last 24 hours) | 12 |
|
||||
| UID | User Identifier | 99 |
|
||||
| GID | Group Identifier | 100 |
|
||||
| GAME_PORT | Port the server will be running on | 27015 |
|
||||
| VALIDATE | Validates the game data | blank |
|
||||
| USERNAME | Leave blank for anonymous login | blank |
|
||||
| PASSWRD | Leave blank for anonymous login | blank |
|
||||
|
||||
## Run example for CS:Source
|
||||
## Run example
|
||||
```
|
||||
docker run --name CSSource -d \
|
||||
-p 27015:27015 -p 27015:27015/udp \
|
||||
--env 'GAME_ID=232330' \
|
||||
--env 'GAME_NAME=cstrike' \
|
||||
--env 'GAME_PORT=27015' \
|
||||
--env 'GAME_PARAMS=-secure +maxplayers 32 +map de_dust2' \
|
||||
docker run --name Palworld -d \
|
||||
-p 8211:8211/udp -p 25575:25575 \
|
||||
--env 'GAME_ID=2394010' \
|
||||
--env 'UPDATE_PUBLIC_IP=false' \
|
||||
--env 'GAME_PARAMS=-publiclobby -rconport=25575' \
|
||||
--env 'GAME_PARAMS_EXTRA=-No-useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS' \
|
||||
--env 'BACKUP=true' \
|
||||
--env 'BACKUP_INTERVAL=120' \
|
||||
--env 'BACKUPS_TO_KEEP=12' \
|
||||
--env 'UID=99' \
|
||||
--env 'GID=100' \
|
||||
--volume /path/to/steamcmd:/serverdata/steamcmd \
|
||||
--volume /path/to/cstrikesource:/serverdata/serverfiles \
|
||||
ich777/steamcmd:latest
|
||||
--volume /path/to/palworld:/serverdata/serverfiles \
|
||||
ich777/steamcmd:palworld
|
||||
```
|
||||
|
||||
This Docker was mainly edited for better use with Unraid, if you don't use Unraid you should definitely try it!
|
||||
|
3
config/PalWorldSettings.ini
Normal file
3
config/PalWorldSettings.ini
Normal file
@@ -0,0 +1,3 @@
|
||||
[/Script/Pal.PalGameWorldSettings]
|
||||
OptionSettings=(Difficulty=None,DayTimeSpeedRate=1.000000,NightTimeSpeedRate=1.000000,ExpRate=1.000000,PalCaptureRate=1.000000,PalSpawnNumRate=1.000000,PalDamageRateAttack=1.000000,PalDamageRateDefense=1.000000,PlayerDamageRateAttack=1.000000,PlayerDamageRateDefense=1.000000,PlayerStomachDecreaceRate=1.000000,PlayerStaminaDecreaceRate=1.000000,PlayerAutoHPRegeneRate=1.000000,PlayerAutoHpRegeneRateInSleep=1.000000,PalStomachDecreaceRate=1.000000,PalStaminaDecreaceRate=1.000000,PalAutoHPRegeneRate=1.000000,PalAutoHpRegeneRateInSleep=1.000000,BuildObjectDamageRate=1.000000,BuildObjectDeteriorationDamageRate=1.000000,CollectionDropRate=1.000000,CollectionObjectHpRate=1.000000,CollectionObjectRespawnSpeedRate=1.000000,EnemyDropItemRate=1.000000,DeathPenalty=All,bEnablePlayerToPlayerDamage=False,bEnableFriendlyFire=False,bEnableInvaderEnemy=True,bActiveUNKO=False,bEnableAimAssistPad=True,bEnableAimAssistKeyboard=False,DropItemMaxNum=3000,DropItemMaxNum_UNKO=100,BaseCampMaxNum=128,BaseCampWorkerMaxNum=15,DropItemAliveMaxHours=1.000000,bAutoResetGuildNoOnlinePlayers=False,AutoResetGuildTimeNoOnlinePlayers=72.000000,GuildPlayerMaxNum=20,PalEggDefaultHatchingTime=72.000000,WorkSpeedRate=1.000000,bIsMultiplay=False,bIsPvP=False,bCanPickupOtherGuildDeathPenaltyDrop=False,bEnableNonLoginPenalty=True,bEnableFastTravel=True,bIsStartLocationSelectByMap=True,bExistPlayerAfterLogout=False,bEnableDefenseOtherGuildPlayer=False,CoopPlayerMaxNum=4,ServerPlayerMaxNum=32,ServerName="Palworld Docker",ServerDescription="Palworld running in Docker",AdminPassword="adminDocker",ServerPassword="Docker",PublicPort=8211,PublicIP="",RCONEnabled=False,RCONPort=25575,Region="",bUseAuth=True,BanListURL="https://api.palworldgame.com/api/banlist.txt")
|
||||
|
10
scripts/start-backup.sh
Normal file
10
scripts/start-backup.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
while true
|
||||
do
|
||||
sleep ${BACKUP_INTERVAL}m
|
||||
cd ${SERVER_DIR}/Pal/Saved
|
||||
tar --warning=no-file-changed --exclude='./Config/CrashReportClient' -czf ${SERVER_DIR}/Backups/$(date '+%Y-%m-%d_%H.%M.%S').tar.gz .
|
||||
cd ${SERVER_DIR}/Backups
|
||||
ls -1tr ${SERVER_DIR}/Backups | sort | head -n -${BACKUPS_TO_KEEP} | xargs -d '\n' rm -f --
|
||||
chmod -R ${DATA_PERM} ${SERVER_DIR}/Backups
|
||||
done
|
@@ -1,68 +1,123 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f ${STEAMCMD_DIR}/steamcmd.sh ]; then
|
||||
echo "SteamCMD not found!"
|
||||
wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
|
||||
tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
|
||||
rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
|
||||
echo "SteamCMD not found!"
|
||||
wget -q -O ${STEAMCMD_DIR}/steamcmd_linux.tar.gz http://media.steampowered.com/client/steamcmd_linux.tar.gz
|
||||
tar --directory ${STEAMCMD_DIR} -xvzf /serverdata/steamcmd/steamcmd_linux.tar.gz
|
||||
rm ${STEAMCMD_DIR}/steamcmd_linux.tar.gz
|
||||
fi
|
||||
|
||||
echo "---Update SteamCMD---"
|
||||
if [ "${USERNAME}" == "" ]; then
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+login anonymous \
|
||||
+quit
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+login anonymous \
|
||||
+quit
|
||||
else
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+login ${USERNAME} ${PASSWRD} \
|
||||
+quit
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+login ${USERNAME} ${PASSWRD} \
|
||||
+quit
|
||||
fi
|
||||
|
||||
echo "---Update Server---"
|
||||
if [ "${USERNAME}" == "" ]; then
|
||||
if [ "${VALIDATE}" == "true" ]; then
|
||||
echo "---Validating installation---"
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login anonymous \
|
||||
+app_update ${GAME_ID} validate \
|
||||
+quit
|
||||
else
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login anonymous \
|
||||
+app_update ${GAME_ID} \
|
||||
+quit
|
||||
fi
|
||||
if [ "${VALIDATE}" == "true" ]; then
|
||||
echo "---Validating installation---"
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login anonymous \
|
||||
+app_update ${GAME_ID} validate \
|
||||
+quit
|
||||
else
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login anonymous \
|
||||
+app_update ${GAME_ID} \
|
||||
+quit
|
||||
fi
|
||||
else
|
||||
if [ "${VALIDATE}" == "true" ]; then
|
||||
echo "---Validating installation---"
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login ${USERNAME} ${PASSWRD} \
|
||||
+app_update ${GAME_ID} validate \
|
||||
+quit
|
||||
if [ "${VALIDATE}" == "true" ]; then
|
||||
echo "---Validating installation---"
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login ${USERNAME} ${PASSWRD} \
|
||||
+app_update ${GAME_ID} validate \
|
||||
+quit
|
||||
else
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login ${USERNAME} ${PASSWRD} \
|
||||
+app_update ${GAME_ID} \
|
||||
+quit
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "---Checking if configuration is in place---"
|
||||
if [ ! -f ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ]; then
|
||||
if [ ! -d ${SERVER_DIR}/Pal/Saved/Config/LinuxServer ]; then
|
||||
mkdir -p ${SERVER_DIR}/Pal/Saved/Config/LinuxServer
|
||||
fi
|
||||
echo "---Configuration not found, downloading...---"
|
||||
wget -qO ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini https://github.com/ich777/docker-steamcmd-server/raw/palworld/config/PalWorldSettings.ini
|
||||
else
|
||||
echo "---Configuration found, continuing...---"
|
||||
fi
|
||||
|
||||
echo "---Checking if PublicIP is in place---"
|
||||
PUBLIC_IP="$(grep -o 'PublicIP="[^"]*"' ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini | cut -d '"' -f2)"
|
||||
if [ -z "${PUBLIC_IP}" ]; then
|
||||
echo "---No PublicIP found in PalWorldSettings.ini, trying to obtain it...---"
|
||||
PUBLIC_IP="$(wget -qO - ipv4.icanhazip.com)"
|
||||
if [ -z "${PUBLIC_IP}" ]; then
|
||||
echo "---Can't get PublicIP, please set it manually in your PalWorldSettings.ini!---"
|
||||
else
|
||||
echo "---Sucessfully obtained PublicIP: ${PUBLIC_IP}, adding to PalWorldSettings.ini"
|
||||
sed -i "s/PublicIP=\"[^\"]*\"/PublicIP=\"${PUBLIC_IP}\"/g" ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
|
||||
fi
|
||||
else
|
||||
if [ "${UPDATE_PUBLIC_IP}" == "true" ]; then
|
||||
NEW_PUBLIC_IP="$(wget -qO - ipv4.icanhazip.com)"
|
||||
if [ -z "${NEW_PUBLIC_IP}" ]; then
|
||||
echo "---Can't get PublicIP, please set it manually in your PalWorldSettings.ini!---"
|
||||
else
|
||||
${STEAMCMD_DIR}/steamcmd.sh \
|
||||
+force_install_dir ${SERVER_DIR} \
|
||||
+login ${USERNAME} ${PASSWRD} \
|
||||
+app_update ${GAME_ID} \
|
||||
+quit
|
||||
if [ "${PUBLIC_IP}" != "${NEW_PUBLIC_IP}" ]; then
|
||||
echo "---Changing PublicIP in PalWorldSettings.ini to: ${NEW_PUBLIC_IP}!---"
|
||||
sed -i "s/PublicIP=\"[^\"]*\"/PublicIP=\"${NEW_PUBLIC_IP}\"/g" ${SERVER_DIR}/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
|
||||
else
|
||||
echo "---Nothing to do, PublicIP: ${PUBLIC_IP} still up-to-date!---"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "---PublicIP in PalWorldSettings.ini found: ${PUBLIC_IP}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "---Prepare Server---"
|
||||
if [ ! -f ${DATA_DIR}/.steam/sdk32/steamclient.so ]; then
|
||||
if [ ! -d ${DATA_DIR}/.steam ]; then
|
||||
mkdir ${DATA_DIR}/.steam
|
||||
fi
|
||||
if [ ! -d ${DATA_DIR}/.steam/sdk32 ]; then
|
||||
mkdir ${DATA_DIR}/.steam/sdk32
|
||||
fi
|
||||
cp -R ${STEAMCMD_DIR}/linux32/* ${DATA_DIR}/.steam/sdk32/
|
||||
if [ ! -f ${SERVER_DIR}/Engine/Binaries/Linux/steamclient.so ]; then
|
||||
ln -s ${SERVER_DIR}/linux64/steamclient.so ${SERVER_DIR}/Engine/Binaries/Linux/steamclient.so
|
||||
fi
|
||||
if [ ! -d ${DATA_DIR}/.steam/sdk64 ]; then
|
||||
mkdir -p ${DATA_DIR}/.steam/sdk64
|
||||
cp -R ${SERVER_DIR}/linux64/* ${DATA_DIR}/.steam/sdk64/
|
||||
fi
|
||||
|
||||
chmod -R ${DATA_PERM} ${DATA_DIR}
|
||||
echo "---Server ready---"
|
||||
|
||||
if [ "${BACKUP}" == "true" ]; then
|
||||
echo "---Starting Backup daemon---"
|
||||
if [ ! -d ${SERVER_DIR}/Backups ]; then
|
||||
mkdir -p ${SERVER_DIR}/Backups
|
||||
fi
|
||||
/opt/scripts/start-backup.sh &
|
||||
fi
|
||||
|
||||
echo "---Start Server---"
|
||||
cd ${SERVER_DIR}
|
||||
${SERVER_DIR}/srcds_run -game ${GAME_NAME} ${GAME_PARAMS} -console +port ${GAME_PORT}
|
||||
if [ -f ${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Shipping ]; then
|
||||
cd ${SERVER_DIR}
|
||||
${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Shipping Pal -nocore ${GAME_PARAMS} ${GAME_PARAMS_EXTRA}
|
||||
elif [ -f ${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Test ]; then
|
||||
cd ${SERVER_DIR}
|
||||
${SERVER_DIR}/Pal/Binaries/Linux/PalServer-Linux-Test Pal -nocore ${GAME_PARAMS} ${GAME_PARAMS_EXTRA}
|
||||
else
|
||||
echo "---Something went wrong, can't find the executable, putting container into sleep mode!---"
|
||||
sleep infinity
|
||||
fi
|
@@ -12,11 +12,11 @@ cp -f /opt/custom/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
||||
cp -f /opt/scripts/user.sh /opt/scripts/start-user.sh > /dev/null 2>&1 ||:
|
||||
|
||||
if [ -f /opt/scripts/start-user.sh ]; then
|
||||
echo "---Found optional script, executing---"
|
||||
chmod -f +x /opt/scripts/start-user.sh ||:
|
||||
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
|
||||
echo "---Found optional script, executing---"
|
||||
chmod -f +x /opt/scripts/start-user.sh ||:
|
||||
/opt/scripts/start-user.sh || echo "---Optional Script has thrown an Error---"
|
||||
else
|
||||
echo "---No optional script found, continuing---"
|
||||
echo "---No optional script found, continuing---"
|
||||
fi
|
||||
|
||||
echo "---Taking ownership of data...---"
|
||||
@@ -26,8 +26,8 @@ chown -R ${UID}:${GID} ${DATA_DIR}
|
||||
|
||||
echo "---Starting...---"
|
||||
term_handler() {
|
||||
kill -SIGTERM "$killpid"
|
||||
wait "$killpid" -f 2>/dev/null
|
||||
kill -SIGTERM $(pidof PalServer-Linux-Test)
|
||||
tail --pid=$(pidof PalServer-Linux-Test) -f 2>/dev/null
|
||||
exit 143;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ su ${USER} -c "/opt/scripts/start-server.sh" &
|
||||
killpid="$!"
|
||||
while true
|
||||
do
|
||||
wait $killpid
|
||||
exit 0;
|
||||
wait $killpid
|
||||
exit 0;
|
||||
done
|
||||
|
Reference in New Issue
Block a user