-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
62 lines (42 loc) · 1.54 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
FROM ubuntu:22.04
LABEL MAINTAINER="_AMD_ ([email protected])"
# Prepare Gmod server and CSS content
# ===================================
RUN dpkg --add-architecture i386 \
&& apt update \
&& apt -y upgrade \
&& apt -y --no-install-recommends install curl lib32stdc++6 libtinfo5:i386 ca-certificates
# /\ for steamcmd /\ fixes readline: https://forum.gm-donate.net/t/7645
# Cleanup
# ===================================
RUN apt-get clean \
&& rm -rf /tmp/* /var/lib/apt/lists/*
# Security
# P.S. 25.04 has default user ubuntu 1000:1000
# ===================================
RUN groupadd -g 1000 steam \
&& useradd -r -m -d /gmodserv -u 1000 -g steam steam
USER steam
ENV HOME=/gmodserv
# SteamCMD + GMOD + CSS
# ===================================
WORKDIR /gmodserv/steamcmd
RUN curl -O https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz \
&& tar -xvzf steamcmd_linux.tar.gz \
&& rm steamcmd_linux.tar.gz
RUN ./steamcmd.sh \
+force_install_dir /gmodserv/content/css \
+login anonymous \
+app_update 232330 -validate \
+quit
RUN ./steamcmd.sh \
+force_install_dir /gmodserv \
+login anonymous \
+app_update 4020 -validate \
+quit
RUN echo '"mountcfg" {"cstrike" "/gmodserv/content/css/cstrike"}' > /gmodserv/garrysmod/cfg/mount.cfg
# Run server
# ===================================
WORKDIR /gmodserv
ENTRYPOINT ["./srcds_run", "-game garrysmod", "-console", "-norestart", "-strictportbind"]
CMD ["-port 27015", "-tickrate 32", "-maxplayers 16", "-insecure", "+map gm_construct"]