Skip to content

Instantly share code, notes, and snippets.

@bbhoss
Created January 19, 2024 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbhoss/a040d253601691c475309839114b4fd4 to your computer and use it in GitHub Desktop.
Save bbhoss/a040d253601691c475309839114b4fd4 to your computer and use it in GitHub Desktop.
Palworld dedicated server
version: '3.7'
services:
palserver:
build: .
ports:
- "8211:8211/udp"
volumes:
- "./palserver/server_home:/home/steam/palserver"
- "./palserver/Steam:/home/steam/Steam"
restart: unless-stopped
# Dockerfile
FROM cm2network/steamcmd:latest
# Set environment variables for the container
ENV STEAMCMD_DIR=/home/steam/steamcmd
ENV SERVER_DIR=/home/steam/palserver
# Switch to user steam
USER steam
# Create server directory
RUN mkdir -p ${SERVER_DIR}
# Copy the entrypoint script into the image
COPY entrypoint.sh /entrypoint.sh
# Expose the server port
EXPOSE 8211/udp
# Set the entrypoint to run the installation script
ENTRYPOINT ["/entrypoint.sh"]
#!/bin/bash
# entrypoint.sh
# Exit on error
set -e
# SteamCMD installation and server setup
STEAMCMD_DIR="/home/steam/steamcmd"
SERVER_DIR="/home/steam/palserver"
STEAMCMD="${STEAMCMD_DIR}/steamcmd.sh"
# Check if server is already installed; if not, install it
if [ ! -f "${SERVER_DIR}/PalServer.sh" ]; then
echo "Installing PalServer..."
${STEAMCMD} +force_install_dir ${SERVER_DIR} +login anonymous +app_update 2394010 validate +quit
fi
# Start the server
echo "Starting PalServer..."
cd ${SERVER_DIR}
./PalServer.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment