-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (46 loc) · 1.66 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
FROM silentmecha/steamcmd:latest
LABEL maintainer="[email protected]"
ENV STEAMAPP_ID 896660
ENV STEAMAPP Valheim
ENV STEAMAPPDIR "${HOME}/${STEAMAPP}-dedicated"
ENV STEAM_SAVEDIR "${STEAMAPPDIR}/Saves"
USER root
COPY ./src/entry.sh ${HOME}/entry.sh
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
file \
jq \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p "${STEAMAPPDIR}" \
&& mkdir -p "${HOME}/mcrcon" \
&& mkdir -p "${HOME}/.config/unity3d/IronGate/Valheim" \
&& wget -c https://github.com/Tiiffi/mcrcon/releases/download/v0.7.1/mcrcon-0.7.1-linux-x86-64.tar.gz -O - | tar -xz -C "${HOME}/mcrcon" --strip-components=1 \
&& chmod +x "${HOME}/entry.sh" \
&& ln -s "${HOME}/.config/unity3d/IronGate/Valheim" ${STEAM_SAVEDIR} \
&& chown -R "${USER}:${USER}" "${HOME}/entry.sh" "${STEAMAPPDIR}" "${HOME}" \
&& chmod -R 744 "${STEAM_SAVEDIR}" "${HOME}/.config/"
ENV SERVER_NAME="Valheim Plus Docker" \
PORT=2456 \
QUERYPORT=2457 \
WORLDPORT=2458 \
WORLD="Dedicated" \
SERVER_PASSWORD="secret"
# Switch to user
USER ${USER}
RUN bash steamcmd \
+login anonymous \
+force_install_dir "${STEAMAPPDIR}" \
+app_update "${STEAMAPP_ID}" validate \
+quit
RUN wget -c $(curl -s https://api.github.com/repos/valheimPlus/ValheimPlus/releases/latest | jq -r '.assets[] | select(.name=="UnixServer.tar.gz").browser_download_url') -O - | tar -xz -C "${STEAMAPPDIR}"
VOLUME ${STEAM_SAVEDIR}
WORKDIR ${HOME}
EXPOSE ${PORT}/udp \
${QUERYPORT}/udp \
${WORLDPORT}/udp \
${PORT}/tcp \
${QUERYPORT}/tcp \
${WORLDPORT}/tcp
CMD ["bash", "entry.sh"]