From 1faa4d89566573dc4a27aaaefadb03d4ab37264d Mon Sep 17 00:00:00 2001 From: zino Date: Wed, 14 Sep 2022 22:30:46 +0200 Subject: [PATCH] Add 'Dockerfile' --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5728221 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +FROM debian:buster-slim + +# Install software +RUN dpkg --add-architecture i386 +RUN apt-get update && \ + apt-get install -y apt-utils vim curl wget file tar bzip2 gzip unzip bsdmainutils python util-linux ca-certificates binutils bc jq tmux netcat lib32gcc1 lib32stdc++6 cpio sudo procps iproute2 + +# Install gamedig +# GameDig is a tool that queries game servers and returns outputs data from a query into json format. It can not only check if the game server is online but also return various data such as current maps and players. This allows ./gameserver details to display live information. +# See https://github.com/gamedig/node-gamedig +RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - +RUN apt-get install -y nodejs +RUN npm install gamedig -g + +# Create new sudo user +RUN useradd -m -s /bin/bash csserver +RUN usermod -aG sudo csserver +RUN echo 'csserver ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers + +# Switch user +USER csserver +WORKDIR /home/csserver + +# Download linuxgsm.sh +RUN wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh csserver + +# Installation of dependencies requires either sudo or root access. LinuxGSM can automatically install dependencies if the user has sudo or is root. +RUN sudo ./csserver install + +# Auto install is useful for automatic server deployments as no user prompt is required. +RUN ./csserver auto-install + +# Get and install serverconfig +RUN wget https://dl.ardestani.org/cs16serverconfig.tar.gz +RUN tar -zxvf cs16serverconfig.tar.gz +RUN rm cs16serverconfig.tar.gz + +CMD /bin/bash -c '/home/csserver/csserver start; /bin/bash'