forked from avivace/ror2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
81 lines (71 loc) · 2.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
###########################################################
# Dockerfile that sets up a Risk of Rain 2 server
###########################################################
FROM steamcmd/steamcmd:ubuntu-20
ARG WINE_REL="stable"
ARG WINE_VER="7.0.0.0~focal-1"
ENV STEAMCMD /usr/bin/steamcmd
ENV STEAMAPPID 1180760
ENV STEAMAPPDIR /root/ror2-dedicated
ENV MODDIR /root/ror2ds-mods
# Default server parameters
ENV R2_PLAYERS 4
ENV R2_HEARTBEAT 0
ENV R2_HOSTNAME "A Risk of Rain 2 dedicated server"
ENV R2_PSW ""
ENV R2_ENABLE_MODS false
ENV R2_SV_PORT 27015
ENV R2_QUERY_PORT 27016
ENV R2_GAMEMODE "ClassicRun"
ENV WINE_REL=$WINE_REL
ENV WINE_VER=$WINE_VER
# stable, devel, staging
ENV WINE_REPLACE_REL "stable"
# Prepare the environment
RUN set -x \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
wget \
software-properties-common \
gnupg2 \
&& wget -O - https://dl.winehq.org/wine-builds/winehq.key | apt-key add - \
&& apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
xauth \
gettext \
winbind \
xvfb \
lib32gcc1 \
&& apt-get install -y --install-recommends --no-install-suggests \
winehq-${WINE_REL}=${WINE_VER} \
wine-${WINE_REL}=${WINE_VER} \
wine-${WINE_REL}-amd64=${WINE_VER} \
wine-${WINE_REL}-i386=${WINE_VER} \
&& mkdir -p "${STEAMAPPDIR}" \
&& "${STEAMCMD}" +force_install_dir /home/steam/steamworks_sdk +login anonymous \
+@sSteamCmdForcePlatformType windows +app_update 1007 +quit \
&& cp /home/steam/steamworks_sdk/*64.dll "${STEAMAPPDIR}"/ \
&& "${STEAMCMD}" +force_install_dir "${STEAMAPPDIR}" +login anonymous +@sSteamCmdForcePlatformType windows +app_update "${STEAMAPPID}" +quit \
&& apt-get remove --purge -y \
wget \
software-properties-common \
gnupg2 \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apt-get clean autoclean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
COPY entry.sh ${STEAMAPPDIR}/entry.sh
COPY default_config.cfg ${STEAMAPPDIR}/default_config.cfg
WORKDIR ${STEAMAPPDIR}
VOLUME ${STEAMAPPDIR}
# Check for message to see if server is ready
HEALTHCHECK --interval=10s --timeout=5s \
CMD grep "Steamworks Server IP discovered" "${STEAMAPPDIR}/entry.log" || exit 1
# Start the server
ENTRYPOINT "${STEAMAPPDIR}/entry.sh"
# Declare default exposed ports
EXPOSE ${R2_SV_PORT}/udp
EXPOSE ${R2_QUERY_PORT}/udp