Include RCON in docker image

This commit is contained in:
Thijs van Loef
2024-01-23 11:22:52 +01:00
parent 933b66c391
commit 0d12d05513
4 changed files with 15 additions and 10 deletions

View File

@@ -4,9 +4,13 @@ LABEL maintainer="thijs@loef.dev"
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
xdg-user-dirs=0.17-2 \ xdg-user-dirs=0.17-2 \
procps=2:3.3.17-5 \ procps=2:3.3.17-5 \
wget=1.21-1+deb11u1 \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/itzg/rcon-cli/releases/download/1.6.4/rcon-cli_1.6.4_linux_amd64.tar.gz -O - | tar -xz
RUN mv rcon-cli /usr/bin/rcon-cli
ENV PORT= \ ENV PORT= \
PUID=1000 \ PUID=1000 \
PGID=1000 \ PGID=1000 \

View File

@@ -51,10 +51,6 @@ services:
# - SERVER_NAME="World of Pals" # - SERVER_NAME="World of Pals"
volumes: volumes:
- ./palworld:/palworld/ - ./palworld:/palworld/
rcon:
image: outdead/rcon:latest
entrypoint: ['/rcon', '-a', 'palworld:25575', '-p', 'adminPasswordHere']
profiles: ['rcon']
``` ```
### Docker Run ### Docker Run
@@ -117,12 +113,14 @@ It is highly recommended you set the following environment values before startin
## Using RCON ## Using RCON
RCON is enabled by default for the palworld-server-docker image. RCON is enabled by default for the palworld-server-docker image.
Using the RCON commands is quite easy: Opening the RCON cli is quite easy:
```bash ```bash
docker compose run --rm rcon "Server Command" docker exec -it palworld-server rcon-cli
``` ```
This will open a CLI that use can use to write commands to the Palworld Server.
### List of server commands ### List of server commands
| Command | Info | | Command | Info |

View File

@@ -21,7 +21,3 @@ services:
# - SERVER_NAME="World of Pals" # - SERVER_NAME="World of Pals"
volumes: volumes:
- ./palworld:/palworld/ - ./palworld:/palworld/
rcon:
image: outdead/rcon:latest
entrypoint: ['/rcon', '-a', 'palworld:25575', '-p', 'adminPasswordHere']
profiles: ['rcon']

View File

@@ -63,6 +63,13 @@ if [ -n "${RCON_PORT}" ]; then
sed -i "s/RCONPort=[0-9]*/RCONPort=$RCON_PORT/" /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini sed -i "s/RCONPort=[0-9]*/RCONPort=$RCON_PORT/" /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi fi
# Configure RCON settings
cat >~/.rcon-cli.yaml <<EOL
host: localhost
port: ${RCON_PORT}
password: ${ADMIN_PASSWORD}
EOL
printf "\e[0;32m*****STARTING SERVER*****\e[0m\n" printf "\e[0;32m*****STARTING SERVER*****\e[0m\n"
echo "${STARTCOMMAND}" echo "${STARTCOMMAND}"
su steam -c "${STARTCOMMAND}" su steam -c "${STARTCOMMAND}"