mirror of
https://github.com/YuzuZensai/palworld-server-docker.git
synced 2026-01-31 14:57:59 +00:00
Merge pull request #16 from fryfrog/add_user
Add PUID and PGID to palworld docker image.
This commit is contained in:
@@ -7,6 +7,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV PORT=8211 \
|
ENV PORT=8211 \
|
||||||
|
PUID=1000 \
|
||||||
|
PGID=1000 \
|
||||||
PLAYERS=16 \
|
PLAYERS=16 \
|
||||||
MULTITHREADING=false \
|
MULTITHREADING=false \
|
||||||
COMMUNITY=false \
|
COMMUNITY=false \
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ services:
|
|||||||
- 27015:27015/udp
|
- 27015:27015/udp
|
||||||
environment:
|
environment:
|
||||||
- PORT=8211
|
- PORT=8211
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
- PLAYERS=16
|
- PLAYERS=16
|
||||||
- MULTITHREADING=FALSE
|
- MULTITHREADING=FALSE
|
||||||
- COMMUNITY=false # Enable this if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD!
|
- COMMUNITY=false # Enable this if you want your server to show up in the community servers tab, USE WITH SERVER_PASSWORD!
|
||||||
@@ -55,6 +57,8 @@ docker run -d \
|
|||||||
-v ./<palworld-folder>:/palworld/ \
|
-v ./<palworld-folder>:/palworld/ \
|
||||||
-e PLAYERS=16 \
|
-e PLAYERS=16 \
|
||||||
-e PORT=8211 \
|
-e PORT=8211 \
|
||||||
|
-e PUID=1000 \
|
||||||
|
-e PGID=1000 \
|
||||||
-e COMMUNITY=false \
|
-e COMMUNITY=false \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
thijsvanloef/palworld-server-docker
|
thijsvanloef/palworld-server-docker
|
||||||
@@ -74,6 +78,8 @@ It is highly recommended you set the following environment values before startin
|
|||||||
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------------- |
|
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------------- |
|
||||||
| PLAYERS* | Max amount of players that are able to join the server | 16 | 1-31 |
|
| PLAYERS* | Max amount of players that are able to join the server | 16 | 1-31 |
|
||||||
| PORT* | UDP port that the server will expose | 8211 | 1024-65535 |
|
| PORT* | UDP port that the server will expose | 8211 | 1024-65535 |
|
||||||
|
| PUID* | The uid of the user the server should run as | 1000 | !0 |
|
||||||
|
| PGID* | The gid of the group the server should run as | 1000 | !0 |
|
||||||
| MULTITHREADING** | Improves performance in multi-threaded CPU environments. It is effective up to a maximum of about 4 threads, and allocating more than this number of threads does not make much sense. | false | true/false |
|
| MULTITHREADING** | Improves performance in multi-threaded CPU environments. It is effective up to a maximum of about 4 threads, and allocating more than this number of threads does not make much sense. | false | true/false |
|
||||||
| COMMUNITY | Whether or not the server shows up in the community server browser (USE WITH SERVER_PASSWORD) | false | true/false |
|
| COMMUNITY | Whether or not the server shows up in the community server browser (USE WITH SERVER_PASSWORD) | false | true/false |
|
||||||
| PUBLIC_IP | You can manually specify the global IP address of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x |
|
| PUBLIC_IP | You can manually specify the global IP address of the network on which the server running.If not specified, it will be detected automatically. If it does not work well, try manual configuration. | | x.x.x.x |
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ services:
|
|||||||
- 27015:27015/udp
|
- 27015:27015/udp
|
||||||
environment:
|
environment:
|
||||||
- PORT=8211
|
- PORT=8211
|
||||||
|
- PUID=1000
|
||||||
|
- PGID=1000
|
||||||
- PLAYERS=16
|
- PLAYERS=16
|
||||||
- MULTITHREADING=false
|
- MULTITHREADING=false
|
||||||
- UPDATE_ON_BOOT=true
|
- UPDATE_ON_BOOT=true
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
|
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
|
mkdir -p /palworld
|
||||||
|
|
||||||
chown -R steam:steam /palworld
|
chown -R steam:steam /palworld
|
||||||
|
|
||||||
if [ "${UPDATE_ON_BOOT}" = true ]; then
|
if [ "${UPDATE_ON_BOOT}" = true ]; then
|
||||||
|
|
||||||
printf "\e[0;32m*****STARTING INSTALL/UPDATE*****\e[0m"
|
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
|
fi
|
||||||
|
|
||||||
./start.sh
|
./start.sh
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
STARTCOMMAND="./PalServer.sh -port=${PORT} -players=${PLAYERS}"
|
STARTCOMMAND="./PalServer.sh -port=${PORT} -players=${PLAYERS}"
|
||||||
|
|
||||||
|
|
||||||
if [ "${COMMUNITY}" = true ]; then
|
if [ "${COMMUNITY}" = true ]; then
|
||||||
STARTCOMMAND="${STARTCOMMAND} EpicApp=PalServer"
|
STARTCOMMAND="${STARTCOMMAND} EpicApp=PalServer"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user