-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
262 lines (235 loc) · 10.3 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# Description: Dockerfile for Palworld Dedicated Server
# Build the rcon binaries (GORCON and custom rcon broadcast built by @thejcpalma)
FROM golang:1.22.0-bookworm as rcon-build
WORKDIR /build
ENV CGO_ENABLED=0 \
GORCON_RCONCLI_URL=https://github.com/gorcon/rcon-cli/archive/refs/tags/v0.10.3.tar.gz \
GORCON_RCONCLI_DIR=rcon-cli-0.10.3 \
GORCON_RCONCLI_TGZ=v0.10.3.tar.gz \
GORCON_RCONCLI_TGZ_SHA1SUM=33ee8077e66bea6ee097db4d9c923b5ed390d583
RUN curl -fsSLO "$GORCON_RCONCLI_URL" \
&& echo "${GORCON_RCONCLI_TGZ_SHA1SUM} ${GORCON_RCONCLI_TGZ}" | sha1sum -c - \
&& tar -xzf "$GORCON_RCONCLI_TGZ" \
&& mv "$GORCON_RCONCLI_DIR"/* ./ \
&& rm "$GORCON_RCONCLI_TGZ" \
&& rm -Rf "$GORCON_RCONCLI_DIR" \
&& go build -v ./cmd/gorcon
WORKDIR /build/custom_rcon_broadcast/
# Build the custom rcon broadcast binary
COPY /src/custom_rcon_broadcast/ .
RUN go build -v -o /build/rcon_broadcast main.go
# Build the supercronic binary
FROM debian:bookworm-slim as supercronic-build
# Latest releases available at https://github.com/aptible/supercronic/releases
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.29/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests ca-certificates curl \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
# Build the final image
FROM --platform=linux/amd64 cm2network/steamcmd:root
LABEL maintainer="João Palma"
LABEL name="thejcpalma/palworld-dedicated-server-docker"
LABEL github="https://github.com/thejcpalma/palworld-dedicated-server-docker"
LABEL dockerhub="https://hub.docker.com/r/thejcpalma/palworld-dedicated-server"
LABEL org.opencontainers.image.authors="João Palma"
LABEL org.opencontainers.image.source="https://github.com/thejcpalma/palworld-dedicated-server-docker"
# Install minimum required packages for dedicated server
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
procps \
xdg-user-dirs \
gettext-base \
jq \
&& apt-get autoremove -y --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy the rcon, custom rcon broadcast (to fix spaces in the message) and supercronic binaries
COPY --from=rcon-build --chmod=755 /build/gorcon /usr/local/bin/rcon
COPY --from=rcon-build --chmod=755 /build/rcon_broadcast /usr/local/bin/rcon_broadcast
COPY --from=supercronic-build --chmod=755 /usr/local/bin/supercronic /usr/local/bin/supercronic
ENV APP_ID=2394010
ENV SERVER_DIR=/home/steam/server
COPY --chown=steam:steam --chmod=755 scripts/ ${SERVER_DIR}/scripts
COPY --chown=steam:steam --chmod=755 entrypoint.sh ${SERVER_DIR}/
RUN ln -s ${SERVER_DIR}/scripts/backup_manager.sh /usr/local/bin/backup_manager \
&& ln -s ${SERVER_DIR}/scripts/rcon/rconcli.sh /usr/local/bin/rconcli \
&& ln -s ${SERVER_DIR}/scripts/wrappers/backup_manager_cli.sh /usr/local/bin/backup \
&& ln -s ${SERVER_DIR}/scripts/wrappers/update.sh /usr/local/bin/update \
&& ln -s ${SERVER_DIR}/scripts/wrappers/restart.sh /usr/local/bin/restart
# Set the default shell to Bash with the 'pipefail' option enabled.
# This changes the pipeline's return status to be the value of the last command
# to exit with a non-zero status, or zero if all commands exit successfully.
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive \
# Container setttings
PUID=1000 \
PGID=1000 \
TZ="Europe/Berlin" \
# Path vars
GAME_ROOT="/palworld" \
GAME_PATH="/palworld/Pal" \
GAME_SAVE_PATH="/palworld/Pal/Saved" \
GAME_CONFIG_PATH="/palworld/Pal/Saved/Config/LinuxServer" \
GAME_SETTINGS_FILE="/palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini" \
GAME_ENGINE_FILE="/palworld/Pal/Saved/Config/LinuxServer/Engine.ini" \
BACKUP_PATH="/palworld/backups" \
STEAMCMD_PATH="/home/steam/steamcmd" \
RCON_CONFIG_FILE="/home/steam/server/configs/rcon.yaml" \
# SteamCMD settings
ALWAYS_UPDATE_ON_START=true \
STEAMCMD_VALIDATE_FILES=true \
# Auto update settings
AUTO_UPDATE_ENABLED=false \
AUTO_UPDATE_CRON_EXPRESSION="0 3 * * *" \
AUTO_UPDATE_WARN_MINUTES=30 \
# Auto restart settings
AUTO_RESTART_ENABLED=false \
AUTO_RESTART_WARN_MINUTES=30 \
AUTO_RESTART_CRON_EXPRESSION="0 5 * * *" \
# Backup settings
BACKUP_ENABLED=true \
BACKUP_CRON_EXPRESSION="0 * * * *" \
BACKUP_AUTO_CLEAN=true \
BACKUP_AUTO_CLEAN_AMOUNT_TO_KEEP=72 \
# Player monitoring settings
PLAYER_MONITOR_ENABLED=true \
PLAYER_MONITOR_INTERVAL=60 \
# Webhook settings
WEBHOOK_ENABLED=false \
WEBHOOK_URL= \
# Webhook messages
WEBHOOK_START_TITLE=":white_check_mark: Starting server" \
WEBHOOK_START_DESCRIPTION="Server is starting" \
WEBHOOK_START_COLOR="65280" \
WEBHOOK_STOP_TITLE=":octagonal_sign: Stopped server" \
WEBHOOK_STOP_DESCRIPTION="Server has been stopped" \
WEBHOOK_STOP_COLOR="16711680" \
WEBHOOK_RESTART_TITLE=":arrows_counterclockwise: Restarting server" \
# X_MINUTES will be replaced with parameter expansion
WEBHOOK_RESTART_DESCRIPTION="Server is restarting in X_MINUTES minute(s) :alarm_clock:" \
WEBHOOK_RESTART_NOW_DESCRIPTION="Server is restarting now! :alarm_clock:" \
WEBHOOK_RESTART_COLOR="16750848" \
WEBHOOK_INSTALL_TITLE=":new: Installing server" \
WEBHOOK_INSTALL_DESCRIPTION="Server is being installed" \
WEBHOOK_INSTALL_COLOR="1644912" \
WEBHOOK_UPDATE_TITLE=":new: Updating server" \
WEBHOOK_UPDATE_DESCRIPTION="Server is being updated" \
WEBHOOK_UPDATE_COLOR="16776960" \
WEBHOOK_UPDATE_VALIDATE_TITLE=":ballot_box_with_check: Updating and validating server" \
WEBHOOK_UPDATE_VALIDATE_DESCRIPTION="Server is being updated and validated" \
WEBHOOK_UPDATE_VALIDATE_COLOR="16776960" \
WEBHOOK_PLAYER_JOIN_TITLE=":mage: Player Joined" \
# PLAYER_NAME will be replaced with parameter expansion
WEBHOOK_PLAYER_JOIN_DESCRIPTION="**PLAYER_NAME**" \
WEBHOOK_PLAYER_JOIN_COLOR="1728512" \
WEBHOOK_PLAYER_LEAVE_TITLE=":dash: Player Left" \
# PLAYER_NAME will be replaced with parameter expansion
WEBHOOK_PLAYER_LEAVE_DESCRIPTION="**PLAYER_NAME**" \
WEBHOOK_PLAYER_LEAVE_COLOR="6291482" \
# Gameserver start settings
MULTITHREAD_ENABLED=true \
COMMUNITY_SERVER=true \
# Config setting - Warning: using 'auto' will overwrite the settings in the PalWorldSettings file with the environment variables
SERVER_SETTINGS_MODE=auto \
# Engine Configuration Mode:
# - 'full' will overwrite the settings in the config file with the environment variables or default values
# - 'modular' will only set the settings in the config file when the corresponding environment variable is set and not empty
# - 'skip' will skip the configuration of the settings in the config file
ENGINE_CONFIG_MODE=modular \
# Engine.ini
LAN_SERVER_MAX_TICK_RATE= \
NET_SERVER_MAX_TICK_RATE=120 \
CONFIGURED_INTERNET_SPEED= \
CONFIGURED_LAN_SPEED= \
MAX_CLIENT_RATE= \
MAX_INTERNET_CLIENT_RATE= \
SMOOTH_FRAME_RATE= \
SMOOTH_FRAME_RATE_UPPER_BOUND= \
SMOOTH_FRAME_RATE_LOWER_BOUND= \
MIN_DESIRED_FRAME_RATE= \
USE_FIXED_FRAME_RATE= \
FIXED_FRAME_RATE= \
NET_CLIENT_TICKS_PER_SECOND= \
TIME_BETWEEN_PURGING_PENDING_KILL_OBJECTS= \
THREADED_RENDERING= \
THREADED_PHYSICS= \
# PalWorldSettings.ini
DIFFICULTY=None \
DAY_TIME_SPEED_RATE=1.000000 \
NIGHT_TIME_SPEED_RATE=1.000000 \
EXP_RATE=1.000000 \
PAL_CAPTURE_RATE=1.000000 \
PAL_SPAWN_NUM_RATE=1.000000 \
PAL_DAMAGE_RATE_ATTACK=1.000000 \
PAL_DAMAGE_RATE_DEFENSE=1.000000 \
PLAYER_DAMAGE_RATE_ATTACK=1.000000 \
PLAYER_DAMAGE_RATE_DEFENSE=1.000000 \
PLAYER_STOMACH_DECREASE_RATE=1.000000 \
PLAYER_STAMINA_DECREACE_RATE=1.000000 \
PLAYER_AUTO_HP_REGENE_RATE=1.000000 \
PLAYER_AUTO_HP_REGENE_RATE_IN_SLEEP=1.000000 \
PAL_STOMACH_DECREACE_RATE=1.000000 \
PAL_STAMINA_DECREACE_RATE=1.000000 \
PAL_AUTO_HP_REGENE_RATE=1.000000 \
PAL_AUTO_HP_REGENE_RATE_IN_SLEEP=1.000000 \
BUILD_OBJECT_DAMAGE_RATE=1.000000 \
BUILD_OBJECT_DETERIORATION_DAMAGE_RATE=1.000000 \
COLLECTION_DROP_RATE=1.000000 \
COLLECTION_OBJECT_HP_RATE=1.000000 \
COLLECTION_OBJECT_RESPAWN_SPEED_RATE=1.000000 \
ENEMY_DROP_ITEM_RATE=1.000000 \
DEATH_PENALTY=All \
ENABLE_PLAYER_TO_PLAYER_DAMAGE=false \
ENABLE_FRIENDLY_FIRE=false \
ENABLE_INVADER_ENEMY=true \
ACTIVE_UNKO=false \
ENABLE_AIM_ASSIST_PAD=true \
ENABLE_AIM_ASSIST_KEYBOARD=false \
DROP_ITEM_MAX_NUM=3000 \
DROP_ITEM_MAX_NUM_UNKO=100 \
BASE_CAMP_MAX_NUM=128 \
BASE_CAMP_WORKER_MAXNUM=15 \
DROP_ITEM_ALIVE_MAX_HOURS=1.000000 \
AUTO_RESET_GUILD_NO_ONLINE_PLAYERS=false \
AUTO_RESET_GUILD_TIME_NO_ONLINE_PLAYERS=72.000000 \
GUILD_PLAYER_MAX_NUM=20 \
PAL_EGG_DEFAULT_HATCHING_TIME=72.000000 \
WORK_SPEED_RATE=1.000000 \
IS_MULTIPLAY=false \
IS_PVP=false \
CAN_PICKUP_OTHER_GUILD_DEATH_PENALTY_DROP=false \
ENABLE_NON_LOGIN_PENALTY=true \
ENABLE_FAST_TRAVEL=true \
IS_START_LOCATION_SELECT_BY_MAP=true \
EXIST_PLAYER_AFTER_LOGOUT=false \
ENABLE_DEFENSE_OTHER_GUILD_PLAYER=false \
COOP_PLAYER_MAX_NUM=4 \
MAX_PLAYERS=32 \
SERVER_NAME="thejcpalma-docker-generated-###RANDOM###" \
SERVER_DESCRIPTION="Palworld Dedicated Server running in Docker by thejcpalma" \
ADMIN_PASSWORD=adminPasswordHere \
SERVER_PASSWORD=serverPasswordHere \
PUBLIC_PORT=8211 \
PUBLIC_IP= \
RCON_ENABLED=false \
RCON_PORT=25575 \
REGION= \
USEAUTH=true \
BAN_LIST_URL=https://api.palworldgame.com/api/banlist.txt \
SHOW_PLAYER_LIST=false
EXPOSE 8211/udp
EXPOSE 25575/tcp
VOLUME ["${GAME_ROOT}"]
WORKDIR ${SERVER_DIR}
HEALTHCHECK --start-period=5m \
CMD pgrep "PalServer-Linux" > /dev/null || exit 1
ENTRYPOINT ["/home/steam/server/entrypoint.sh"]