-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
77 lines (68 loc) · 1.98 KB
/
Dockerfile
File metadata and controls
77 lines (68 loc) · 1.98 KB
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
## Pull our base image
FROM debian:13-slim
## Image Information
LABEL maintainer="Jeff Nelson <jeff@netwar.org>"
ARG DEBIAN_FRONTEND=noninteractive
## Set Build Arguments
ENV APP_DIR="/app" \
GAME_DIR="/app/palworld" \
GAME_USER="steam" \
STEAMCMD_APP="2394010" \
STEAMCMD_USER="anonymous" \
STEAMCMD_PASSWORD="" \
STEAMCMD_AUTH_CODE="" \
STEAMCMD_DIR="/app/steamcmd"
## Start building our server
RUN dpkg --add-architecture i386 \
&& apt update \
&& apt install -y \
curl \
lib32gcc-s1 \
lib32ncurses-dev \
lib32stdc++6 \
lib32z1 \
libtinfo6 \
libc6 \
zlib1g \
libsdl2-2.0-0 \
libcurl3t64-gnutls:i386 \
libgdiplus \
wget \
unzip \
sqlite3 \
net-tools \
procps \
&& apt clean \
&& rm -rf /var/tmp/* /var/lib/apt/lists/* /tmp/* \
\
## Create Directory Structure
&& mkdir -p $GAME_DIR \
&& mkdir -p $STEAMCMD_DIR \
\
## Create our User
&& useradd -ms /bin/bash $GAME_USER \
\
## Set Directory Permissions
&& chown -R $GAME_USER:$GAME_USER $GAME_DIR \
&& chown -R $GAME_USER:$GAME_USER $STEAMCMD_DIR
## Change to our User
USER $GAME_USER
## Download SteamCMD
RUN curl -s https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xzC $STEAMCMD_DIR \
&& $STEAMCMD_DIR/steamcmd.sh \
+login $STEAMCMD_USER $STEAMCMD_PASSWORD $STEAMCMD_AUTH_CODE \
+quit \
\
## Create symlinks and appid for Steam
&& mkdir -p ~/.steam/sdk64 \
&& ln -s $STEAMCMD_DIR/linux64/steamclient.so ~/.steam/sdk64/steamclient.so \
&& echo "$STEAMCMD_APP" > $GAME_DIR/steam_appid.txt
## Copy our run script into the image
COPY run.sh $APP_DIR/run.sh
## Set working directory
WORKDIR $APP_DIR
## Health check to monitor PalServer process
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
CMD pgrep -f PalServer || exit 1
## Start the run script
CMD ["bash", "run.sh"]