Created
January 19, 2024 23:45
-
-
Save bbhoss/a040d253601691c475309839114b4fd4 to your computer and use it in GitHub Desktop.
Palworld dedicated server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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