forked from jusito/docker-ttt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
180 lines (165 loc) · 5.91 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
FROM debian:buster-slim as lgsm
# Const \\ Overwrite Env \\ Configs possible \\ Configs needed
# C.UTF-8 -> en_US.UTF-8
ENV STEAM_PATH="/home/steam" \
SERVER_PATH="/home/steam/serverfiles" \
STEAM_CMD="/home/steam/.steam/steamcmd" \
GROUP_ID=10000 \
USER_ID=10000 \
DOCKER_USER=steam \
SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 \
\
\
DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8 \
TERM=xterm \
\
\
DEBUGGING=false \
CRON_MONITOR="*/5 * * * *" \
CRON_UPDATE="*/30 * * * *" \
CRON_FORCE_UPDATE="0 10 * * 0" \
CRON_LOG_ROTATE="0 0 * * 0" \
\
\
SERVER_EXECUTABLE="" \
SERVER_GAME="" \
TZ="Europe/Berlin"
#https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
ENTRYPOINT ["./home/entrypoint.sh"]
#WORKDIR "$STEAM_PATH"
COPY ["lgsm/entrypoint.sh", "lgsm/initCron.sh", "lgsm/createAlias.sh", "/home/"]
# procps needed for ps command
# iproute2 needed because of "-slim"
RUN dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get install -y bc binutils bsdmainutils bzip2 ca-certificates cpio curl file gzip hostname jq lib32gcc1 lib32stdc++6 netcat python3 tar tmux unzip util-linux wget xz-utils lib32gcc1 lib32stdc++6 libsdl2-2.0-0:i386 distro-info \
libtinfo5:i386 \
procps iproute2 && \
\
groupadd -g $GROUP_ID $DOCKER_USER && \
useradd -d "$STEAM_PATH" -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \
chown "$DOCKER_USER:$DOCKER_USER" /home/entrypoint.sh && \
chown "$DOCKER_USER:$DOCKER_USER" /home/initCron.sh && \
mkdir -p "$SERVER_PATH" && \
chown -R "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH" && \
chmod a=rx /home/entrypoint.sh && \
chmod a=rx /home/initCron.sh && \
chmod a=rx /home/createAlias.sh && \
\
ulimit -n 2048 && \
\
wget -O "$STEAM_PATH/linuxgsm.sh" "https://linuxgsm.sh" && \
chown "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH/linuxgsm.sh" && \
chmod +x "$STEAM_PATH/linuxgsm.sh" && \
\
\
wget -O "${SUPERCRONIC}" "$SUPERCRONIC_URL" && \
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
chmod +x "$SUPERCRONIC" && \
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
FROM lgsm as gmod
# Const \\ Overwrite Env \\ Configs optional
ENV CSS_PATH="/home/steam/addons/css" \
HL2_PATH="/home/steam/addons/hl2" \
HLDM_PATH="/home/steam/addons/hldm" \
TF2_PATH="/home/steam/addons/tf2" \
\
\
SERVER_EXECUTABLE="gmodserver" \
SERVER_GAME="gmodserver" \
\
\
WORKSHOP_COLLECTION_ID="" \
WORKSHOP_API_KEY="" \
WORKSHOP_AUTOLOAD="true" \
SERVER_NAME="LinuxGSM" \
SERVER_PASSWORD="" \
SERVER_RCON_PASSWORD="" \
SERVER_VOICE_ENABLE="1" \
SERVER_IP="0.0.0.0" \
SERVER_PORT="27015" \
SERVER_CLIENTPORT="27005" \
SERVER_SOURCETVPORT="27020" \
SERVER_DEFAULT_MAP="gm_construct" \
SERVER_MAX_PLAYERS="16" \
SERVER_TICKRATE="66" \
SERVER_GAMEMODE="sandbox" \
SERVER_LOGIN_TOKEN="" \
SERVER_ADDITIONAL_PARAMETERS="-disableluarefresh" \
LGSM_DISPLAYIP="" \
LGSM_POSTALERT="off" \
LGSM_POSTDAYS="7" \
LGSM_POSTTARGET="https://hastebin.com" \
LGSM_DISCORDALERT="off" \
LGSM_DISCORDWEBHOOK="webhook" \
LGSM_EMAILALERT="off" \
LGSM_EMAIL="[email protected]" \
LGSM_EMAILFROM="" \
LGSM_IFTTTALERT="off" \
LGSM_IFTTTTOKEN="accesstoken" \
LGSM_IFTTTEVENT="linuxgsm_alert" \
LGSM_MAILGUNALERT="off" \
LGSM_MAILGUNTOKEN="accesstoken" \
LGSM_MAILGUNDOMAIN="example.com" \
LGSM_MAILGUNEMAILFROM="[email protected]" \
LGSM_MAILGUNEMAIL="[email protected]" \
LGSM_PUSHBULLETALERT="off" \
LGSM_PUSHBULLETTOKEN="accesstoken" \
LGSM_CHANNELTAG="" \
LGSM_PUSHOVERALERT="off" \
LGSM_PUSHOVERTOKEN="accesstoken" \
LGSM_TELEGRAMALERT="off" \
LGSM_TELEGRAMTOKEN="accesstoken" \
LGSM_TELEGRAMCHATID="" \
LGSM_CURLCUSTOMSTRING="" \
LGSM_UPDATEONSTART="off" \
LGSM_MAXBACKUPS="4" \
LGSM_MAXBACKUPDAYS="30" \
LGSM_STOPONBACKUP="on" \
LGSM_CONSOLELOGGING="on" \
LGSM_LOGDAYS="7" \
LGSM_QUERYDELAY="5" \
LGSM_BRANCH="" \
LGSM_STEAMMASTER="true" \
\
INSTALL_CSS=false \
INSTALL_HL2=false \
INSTALL_HLDM=false \
INSTALL_TF2=false \
LGSM_UPDATE=true \
\
USE_MY_REPLACER_CONFIG=false
COPY ["gmod/prepareServer.sh", "gmod/initConfig.sh", "gmod/forceWorkshopDownload.sh", "gmod/installAndMountAddons.sh", "gmod/common.cfg", "/home/"]
RUN chown "$DOCKER_USER:$DOCKER_USER" /home/prepareServer.sh && \
chown "$DOCKER_USER:$DOCKER_USER" /home/initConfig.sh && \
chown "$DOCKER_USER:$DOCKER_USER" /home/forceWorkshopDownload.sh && \
chown "$DOCKER_USER:$DOCKER_USER" /home/installAndMountAddons.sh && \
chmod a=rx /home/prepareServer.sh && \
chmod a=rx /home/initConfig.sh && \
chmod a=rx /home/forceWorkshopDownload.sh && \
chmod a=rx /home/installAndMountAddons.sh && \
\
/home/createAlias.sh "backup" '/home/steam/gmodserver backup' && \
/home/createAlias.sh "console" '/home/steam/gmodserver console' && \
/home/createAlias.sh "debug" '/home/steam/gmodserver debug' && \
/home/createAlias.sh "details" '/home/steam/gmodserver details' && \
/home/createAlias.sh "force-update" '/home/steam/gmodserver force-update' && \
/home/createAlias.sh "install" '/home/steam/gmodserver install' && \
/home/createAlias.sh "monitor" '/home/steam/gmodserver monitor' && \
/home/createAlias.sh "postdetails" '/home/steam/gmodserver postdetails' && \
/home/createAlias.sh "restart" '/home/steam/gmodserver restart' && \
/home/createAlias.sh "start" '/home/steam/gmodserver start' && \
/home/createAlias.sh "stop" '/home/steam/gmodserver stop' && \
/home/createAlias.sh "test-alert" '/home/steam/gmodserver test-alert' && \
/home/createAlias.sh "update" '/home/steam/gmodserver update' && \
/home/createAlias.sh "update-lgsm" '/home/steam/gmodserver update-lgsm' && \
/home/createAlias.sh "validate" '/home/steam/gmodserver validate'
FROM gmod as TTT
ENV SERVER_GAMEMODE="terrortown"
COPY "TTT/server.cfg.default" "/home/server.cfg.default"
USER "$USER_ID:$GROUP_ID"
VOLUME "$SERVER_PATH"