-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathDockerfile
52 lines (42 loc) · 1.6 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
###########################################################
# Dockerfile that builds a Project Zomboid Gameserver
###########################################################
FROM cm2network/steamcmd:root
LABEL maintainer="daniel.carrasco@electrosoftcloud.com"
ENV STEAMAPPID=380870
ENV STEAMAPP=pz
ENV STEAMAPPDIR="${HOMEDIR}/${STEAMAPP}-dedicated"
# Fix for a new installation problem in the Steamcmd client
ENV HOME="${HOMEDIR}"
# Install required packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
dos2unix \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Generate locales to allow other languages in the PZ Server
RUN sed -i 's/^# *\(es_ES.UTF-8\)/\1/' /etc/locale.gen \
# Generate locale
&& locale-gen
# Download the Project Zomboid dedicated server app using the steamcmd app
# Set the entry point file permissions
RUN set -x \
&& mkdir -p "${STEAMAPPDIR}" \
&& chown -R "${USER}:${USER}" "${STEAMAPPDIR}" \
&& bash "${STEAMCMDDIR}/steamcmd.sh" +force_install_dir "${STEAMAPPDIR}" \
+login anonymous \
+app_update "${STEAMAPPID}" validate \
+quit
# Copy the entry point file
COPY --chown=${USER}:${USER} scripts/entry.sh /server/scripts/entry.sh
RUN chmod 550 /server/scripts/entry.sh
# Copy searchfolder file
COPY --chown=${USER}:${USER} scripts/search_folder.sh /server/scripts/search_folder.sh
RUN chmod 550 /server/scripts/search_folder.sh
# Create required folders to keep their permissions on mount
RUN mkdir -p "${HOMEDIR}/Zomboid"
WORKDIR ${HOMEDIR}
# Expose ports
EXPOSE 16261-16262/udp \
27015/tcp
ENTRYPOINT ["/server/scripts/entry.sh"]