Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
81 lines (68 loc) · 2.99 KB
/
Copy pathDockerfile
File metadata and controls
81 lines (68 loc) · 2.99 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
78
79
80
81
# digest pinned 2026-07-04 - update the digest manually when bumping the base image
FROM cm2network/steamcmd:root@sha256:e6b6b3503bf0e41feafe12dc709c90151afba193e1292cac55d28a7d470b1493 AS wine-base
ENV DEBIAN_FRONTEND=noninteractive \
# Path-vars
WINEPREFIX=/wine \
# Container-settings
TIMEZONE=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
&& echo $TIMEZONE > /etc/timezone \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests apt-transport-https gnupg2 wget gosu procps winbind xvfb \
&& mkdir -pm755 /etc/apt/keyrings \
&& wget --output-document /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key \
&& wget --timestamping --directory-prefix=/etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/trixie/winehq-trixie.sources \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests winehq-stable \
&& apt-get remove -y --purge apt-transport-https gnupg2 wget \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
FROM wine-base AS gameserver
LABEL maintainer="Sebastian Schmidt - https://github.com/jammsen/docker-the-forest-dedicated-server"
LABEL org.opencontainers.image.authors="Sebastian Schmidt"
LABEL org.opencontainers.image.source="https://github.com/jammsen/docker-the-forest-dedicated-server"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive \
# Path-vars
GAME_PATH="/theforest" \
GAME_SAVEGAME_PATH="/theforest/saves" \
GAME_CONFIG_PATH="/theforest/config" \
GAME_CONFIGFILE_PATH="/theforest/config/config.cfg" \
STEAMCMD_PATH="/home/steam/steamcmd" \
THEFOREST_TEMPLATE_FILE="/server.cfg.example" \
WINEDATA_PATH="/winedata" \
# Wine/Xvfb-settings
WINEARCH=win64 \
WINEPREFIX="/winedata/WINE64" \
DISPLAY=:1.0 \
# Container-settings
PUID=1000 \
PGID=1000 \
TIMEZONE=Europe/Berlin \
SERVER_SETTINGS_MODE=auto \
FILTER_SHADER_AND_MESH_AND_WINE_DEBUG=true \
# SteamCMD-settings
ALWAYS_UPDATE_ON_START=true \
# Gameserver-start-settings
SERVER_STEAM_ACCOUNT_TOKEN= \
SERVER_NAME="jammsen-docker-generated-###RANDOM###" \
ADMIN_PASSWORD=adminPasswordHere \
SERVER_PASSWORD=serverPasswordHere
VOLUME ["${GAME_PATH}"]
EXPOSE 8766/udp 27015/udp 27016/udp
COPY --chmod=755 entrypoint.sh /
COPY --chmod=755 scripts/ /scripts
COPY --chmod=755 includes/ /includes
COPY --chmod=644 configs/server.cfg.example /
RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \
&& echo $TIMEZONE > /etc/timezone \
&& mkdir -p ${WINEPREFIX}
RUN gosu --version \
&& gosu nobody true \
&& wine --version
HEALTHCHECK --interval=10s --timeout=10s --start-period=30s --retries=3 \
CMD pgrep -f "[Z]:.*TheForestDedicatedServer.exe" >/dev/null 2>&1 || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/scripts/servermanager.sh"]