forked from BrettMayson/Arma3Server
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
103 lines (92 loc) · 3.2 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
FROM debian:bullseye-slim as build_stage
LABEL org.opencontainers.image.authors="Myles Gray, Florian Linke"
LABEL org.opencontainers.image.source='https://github.com/mylesagray/arma3server'
LABEL org.opencontainers.image.url='https://github.com/mylesagray/arma3server'
LABEL org.opencontainers.image.documentation='https://github.com/mylesagray/arma3server'
ENV PUID=1000 \
PGID=1000 \
ARMA_BINARY=/arma3/arma3server \
ARMA_CONFIG=main.cfg \
ARMA_PROFILE=main \
ARMA_WORLD=empty \
ARMA_LIMITFPS=1000 \
ARMA_PARAMS= \
ARMA_CDLC= \
HEADLESS_CLIENTS=0 \
PORT=2302 \
STEAM_BRANCH=public \
STEAM_BRANCH_PASSWORD= \
STEAM_APPID=233780 \
STEAM_APPDIR="/arma3" \
MODS_LOCAL=true \
MODS_PRESET= \
USER="steam"
ENV HOMEDIR "/home/${USER}"
ENV STEAMCMDDIR "${HOMEDIR}/steamcmd"
RUN set -x \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
lib32stdc++6=10.2.1-6 \
lib32gcc-s1=10.2.1-6 \
ca-certificates=20210119 \
nano \
curl \
locales \
build-essential \
libsdl2-2.0-0:i386 \
python3 \
python3-dev \
python3-pip \
rename \
wget \
procps \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
# Create unprivileged user
&& useradd -u "${PUID}" -m "${USER}" \
# Download SteamCMD, execute as user
&& su "${USER}" -c \
"mkdir -p \"${STEAMCMDDIR}\" \
&& wget -qO- 'https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz' | tar xvzf - -C \"${STEAMCMDDIR}\" \
&& \"./${STEAMCMDDIR}/steamcmd.sh\" +quit \
&& mkdir -p \"${HOMEDIR}/.steam/sdk32\" \
&& ln -s \"${STEAMCMDDIR}/linux32/steamclient.so\" \"${HOMEDIR}/.steam/sdk32/steamclient.so\" \
&& ln -s \"${STEAMCMDDIR}/linux32/steamcmd\" \"${STEAMCMDDIR}/linux32/steam\" \
&& ln -s \"${STEAMCMDDIR}/steamcmd.sh\" \"${STEAMCMDDIR}/steam.sh\"" \
# Symlink steamclient.so; So misconfigured dedicated servers can find it
&& ln -s "${STEAMCMDDIR}/linux64/steamclient.so" "/usr/lib/x86_64-linux-gnu/steamclient.so" \
&& ln -s "${STEAMCMDDIR}/linux32/steamclient.so" "/usr/lib/i386-linux-gnu/steamclient.so" \
# Clean up
&& apt-get remove --purge -y \
wget \
curl \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p "${STEAM_APPDIR}" \
&& chmod 755 "${STEAM_APPDIR}" \
&& chown -R "${USER}:${USER}" "${STEAM_APPDIR}"
FROM build_stage AS bullseye-root
WORKDIR ${STEAMCMDDIR}
FROM bullseye-root AS bullseye
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
# Switch to user
USER ${USER}
STOPSIGNAL SIGINT
WORKDIR /app
COPY app/ .
RUN python3 -m pip install pipenv
RUN python3 -m pipenv install --system --deploy
WORKDIR /arma3
CMD ["python3","/app/launch.py"]
# Expose ports
EXPOSE 2302/udp \
2303/udp \
2304/udp \
2305/udp \
2306/udp