-
Notifications
You must be signed in to change notification settings - Fork 56
/
Dockerfile
45 lines (36 loc) · 1.48 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
###########################################################
# Dockerfile that builds a CSGO Gameserver
###########################################################
FROM cm2network/steamcmd:root
LABEL maintainer="[email protected]"
ENV STEAMAPPID 380870
ENV STEAMAPP pz
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
# 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/*
# 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"]