forked from cyrale/project-zomboid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
55 lines (47 loc) · 1.65 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
FROM arguser/linuxgsm
# Steam ports
ENV STEAM_PORT_1=8766 \
STEAM_PORT_2=8767 \
# RCON
RCON_PORT=27015 \
RCON_PASSWORD="rcon-password" \
# Server informations
SERVER_NAME="pzserver" \
SERVER_PASSWORD="" \
SERVER_PUBLIC_NAME="Project Zomboid Server" \
SERVER_PUBLIC_DESC="" \
SERVER_BRANCH="" \
SERVER_BETA_PASSWORD="" \
# Admin DB Password (required for the first launch)
ADMIN_PASSWORD="pzserver-password" \
# Server port
SERVER_PORT=16261 \
# Game UDP port to allow player to contact the server (by default : 10 players)
PLAYER_PORTS=16262-16272
# Switch to root to use apt-get
USER root
# Install dependencies
RUN apt-get update && \
apt-get install --no-install-recommends -y \
rng-tools && \
apt-get -y autoremove && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/* && \
rm -rf /var/tmp/*
# Create server directories and link to access them
RUN [ -d /home/linuxgsm/Zomboid ] || mkdir -p /home/linuxgsm/Zomboid && \
chown linuxgsm:linuxgsm /home/linuxgsm/Zomboid && \
ln -s /home/linuxgsm/Zomboid /server-data && \
[ -d /home/linuxgsm/serverfiles ] || mkdir -p /home/linuxgsm/serverfiles && \
chown linuxgsm:linuxgsm /home/linuxgsm/serverfiles && \
ln -s /home/linuxgsm/serverfiles /server-files
# Copy scripts
COPY ./scripts/*.sh /
RUN chmod +x /*.sh
# Switch to the user steam
USER linuxgsm
# Make server port available to host : (10 slots)
EXPOSE ${STEAM_PORT_1}/udp ${STEAM_PORT_2}/udp ${SERVER_PORT}/udp ${PLAYER_PORTS} ${RCON_PORT}
# Persistant folder with server data : /server-data
VOLUME ["/server-data", "/server-files"]