Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jammsen committed Jan 19, 2024
0 parents commit 41466ef
Show file tree
Hide file tree
Showing 9 changed files with 269 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gitignore
game
77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Bug report"
description: Create a bug report or help us improve things
body:
- type: markdown
attributes:
value: |
## Important information
Please understand you are asking for support for the Docker-Image and Docker-Container. I'm NOT the creator of the Dedicated-Game-Server itself, i'm not involved in programming that. If you need help for that, you might want to ask here for topics related to that: https://tech.palworldgame.com/dedicated-server-guide
- type: checkboxes
id: understand-important-info
attributes:
label: Have you read the Important information text above
options:
- label: Yes i did
required: true
- type: textarea
id: current-behavior
attributes:
label: Current behavior
description: A clear and concise description of what the problem is.
placeholder: Currently...
validations:
required: true
- type: textarea
id: desired-behavior
attributes:
label: Desired behavior
description: Remember, im not familiar with your setup, your permission, your Docker settings and all that kind of stuff, please provide a clear description of what your desired outcome is.
placeholder: Desried ...
validations:
required: true
- type: textarea
id: screenshot-links
attributes:
label: Links to screenshots
placeholder: ...
validations:
required: false
- type: textarea
id: reproduction
attributes:
label: To Reproduce
description: What steps can i do to reproduce your problem?
value: |
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: software
attributes:
label: Software setup
value: |
- OS:
- Docker:
validations:
required: true
- type: textarea
id: hardware
attributes:
label: Hardware setup
value: |
- vCPU:
- RAM:
- Disk:
validations:
required: true
- type: textarea
id: more
attributes:
label: Additional context
placeholder: Add any other context about the problem here, in as much detail as possible.
validations:
required: false
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
32 changes: 32 additions & 0 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: docker-build-and-push-ci

on:
push:
branches:
- 'master'

jobs:
docker-build-gameserver-image:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: jammsen/palworld-dedicated-server:latest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
game
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM cm2network/steamcmd

LABEL org.opencontainers.image.authors="Sebastian Schmidt"
LABEL org.opencontainers.image.source="https://github.com/jammsen/docker-palworld-dedicated-server"

ENV TIMEZONE=Europe/Berlin \
DEBIAN_FRONTEND=noninteractive \
PUID=0 \
PGID=0 \
ALWAYS_UPDATE_ON_START=false \
GAME_PORT=8211 \
MAX_PLAYERS=16 \
SERVER_NAME="jammsen-docker-generated" \
SERVER_PASSWORD="test" \
MULTITHREAD_ENABLED=true \
COMMUNITY_SERVER=true \
PUBLIC_IP=10.0.0.5 \
PUBLIC_PORT=8211

VOLUME ["/palworld"}

EXPOSE 8211/tcp 8211/udp

ADD servermanager.sh /servermanager.sh

CMD ["/servermanager.sh"]
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
## Docker - Palworld Dedicated Server

[![Build Docker Image](https://github.com/jammsen/docker-palworld-dedicated-server/actions/workflows/docker-build-and-push.yml/badge.svg)](https://github.com/jammsen/docker-palworld-dedicated-server/actions/workflows/docker-build-and-push.yml)
![Docker Pulls](https://img.shields.io/docker/pulls/jammsen/palworld-dedicated-server)
![Docker Stars](https://img.shields.io/docker/stars/jammsen/palworld-dedicated-server)
![Image Size](https://img.shields.io/docker/image-size/jammsen/palworld-dedicated-server/latest)

This includes a Palworld Dedicated Server based on Linux and Docker.

## Do you need support for this Docker Image

- What to do?
- Feel free to create a NEW issue
- It is okay to "reference" that you might have the same problem as the person in issue #number
- Follow the instructions and answer the questions of people who are willing to help you
- If your issue is done, close it
- I will Inactivity-Close any issue thats not been active for a week
- What NOT to do?
- Dont re-use issues / Necro!
- You are most likely to chat/spam/harrass thoose participants who didnt agree to be part of your / a new problem and might be totally out of context!
- If this happens, i reserve the rights to lock the issue or delete the comments, you have been warned!

## What you need to run this

- Basic understanding of Docker and Docker-Compose, Linux and Networking (Port-Forwarding/NAT)

## Getting started

1. Create `game` sub-directories on your Dockernode in your game-server-directory (`/srv/palworld`)
2. Setup Port-Forwarding or NAT for the ports in the Docker-Compose file
3. (Build if needed )Start via `docker-compose up -d` - See docker-compose.yml and next section for more infos

## Environment-Variables
| Variable | Describe | Default Value | Allowed Value |
| ---------------------- | ---------------------------------------------------------------- | ------------- | ------------- |
| ALWAYS_UPDATE_ON_START | Updates the server on startup | true | false/true |
| GAME_PORT | Game port of the server | 8211 | 1024-65535 |
| MAX_PLAYERS | Maximum amout of players | 32 | 1-32 |
| SERVER_NAME | Name of the server | | string |
| SERVER_PASSWORD | Password of the server | | string |
| MULTITHREAD_ENABLED | Sets options for "Improved multi-threaded CPU performance" | true | false/true |
| COMMUNITY_SERVER | Sets the server to a "Community-Server", will appear in the list | false | false/true |
| PUBLIC_IP | Public ip, auto-detect if not specified | false | ip address |
| PUBLIC_PORT | Public port, auto-detect if not specified | false | 1024-65535 |
| | | | |
| | | | |
Look at https://tech.palworldgame.com/optimize-game-balance for more information

## Planned features in the future

- Feel free to suggest something

## Software used

- CM2Network SteamCMD (Officially recommended by Valve - https://developer.valvesoftware.com/wiki/SteamCMD#Docker)
- Palworld Dedicated Server (APP-ID: 2394010 - https://steamdb.info/app/2394010/config/)
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.9'
services:
palworld-dedicated-server:
build: .
container_name: palworld-dedicated-server
image: jammsen/palworld-dedicated-server:latest
restart: always
network_mode: bridge
ports:
- 8211:8211
environment:
- ALWAYS_UPDATE_ON_START=false
- GAME_PORT=8211
- MAX_PLAYERS=16
- SERVER_NAME=jammsen-docker-generated
- SERVER_PASSWORD=
- MULTITHREAD_ENABLED=true
- COMMUNITY_SERVER=true
- PUBLIC_IP=
- PUBLIC_PORT=
volumes:
- ./game:/palworld
51 changes: 51 additions & 0 deletions servermanager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

GAME_PATH="/palworld/"

function installServer() {
# force a fresh install of all
echo ">>> Doing a fresh install of the gameserver"
/home/steam/steamcmd/steamcmd.sh +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit
}

function updateServer() {
# force an update and validation
echo ">>> Doing an update of the gameserver"
/home/steam/steamcmd/steamcmd.sh +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit
}

function startServer() {
echo ">>> Starting the gameserver"
cd $GAME_PATH
START_OPTIONS=""
if [[ -n $COMMUNITY_SERVER ]] && [[ $COMMUNITY_SERVER == "true" ]]; then
START_OPTIONS="$START_OPTIONS EpicApp=PalServer"
fi
if [[ -n $MULTITHREAD_ENABLED ]] && [[ $MULTITHREAD_ENABLED == "true" ]]; then
START_OPTIONS="$START_OPTIONS -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
fi
if [[ -n $PUBLIC_IP ]]; then
START_OPTIONS="$START_OPTIONS -publicip=$PUBLIC_IP"
fi
if [[ -n $PUBLIC_PORT ]]; then
START_OPTIONS="$START_OPTIONS -publicport=$PUBLIC_PORT"
fi
if [[ -n $SERVER_PASSWORD ]]; then
START_OPTIONS="$START_OPTIONS -serverpassword=$SERVER_PASSWORD"
fi

./PalServer.sh port="$GAME_PORT" players="$MAX_PLAYERS" "$START_OPTIONS" -servername="$SERVER_NAME"
}

function startMain() {
# Check if server is installed, if not try again
if [ ! -f "/palworld/PalServer.sh" ]; then
installServer
fi
if [ $ALWAYS_UPDATE_ON_START == "true" ]; then
updateServer
fi
startServer
}

startMain

0 comments on commit 41466ef

Please sign in to comment.