From a67dc17a6fac8689ace59260ea7961032fd7a4a6 Mon Sep 17 00:00:00 2001 From: Lucas Briese Date: Tue, 25 Sep 2018 16:18:01 +0200 Subject: [PATCH] + migrated base to lgsm --- Dockerfile | 24 +++++++++++------------- entrypoint.sh | 19 +++++++++++++++++-- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index f1185f5..6b76af1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM ubuntu:16.04 EXPOSE 27015/udp 27015/tcp ENV STEAM_PATH="/home/steam" \ - SERVER_PATH="/home/steam/server" \ + SERVER_PATH="/home/steam/serverfiles" \ GROUP_ID=10000 \ USER_ID=10000 \ DOCKER_USER=steam \ @@ -19,7 +19,8 @@ ENV STEAM_PATH="/home/steam" \ HLDM_PATH="/home/steam/addons/hldm" \ TF2_PATH="/home/steam/addons/tf2" \ \ - USE_MY_REPLACER_CONFIG=false + USE_MY_REPLACER_CONFIG=false \ + DEBIAN_FRONTEND=noninteractive ENTRYPOINT ["./home/entrypoint.sh"] @@ -29,25 +30,22 @@ COPY ["entrypoint.sh", "/home/"] RUN dpkg --add-architecture i386 && \ apt-get update -y && \ apt-get install -y mailutils postfix curl wget file bzip2 gzip unzip bsdmainutils python util-linux ca-certificates binutils bc jq tmux lib32gcc1 libstdc++6 libstdc++6:i386 lib32tinfo5 \ - locales && \ + locales sudo && \ \ groupadd -g $GROUP_ID $DOCKER_USER && \ - useradd -d /home/steam/ -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \ + useradd -d "$STEAM_PATH" -g $GROUP_ID -u $USER_ID -m $DOCKER_USER && \ chown "$DOCKER_USER:$DOCKER_USER" /home/entrypoint.sh && \ - mkdir -p "$SERVER_PATH" && \ + sudo -u "$DOCKER_USER" mkdir -p "$SERVER_PATH" && \ chown -R "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH" && \ chmod a=rx /home/entrypoint.sh && \ - chmod a=rx /home/installAndMountAddons.sh && \ - chmod a=rx /home/forceWorkshopDownload.sh && \ - chmod a=rx /home/experimental.sh && \ - ulimit -n 2048 && \ \ + ulimit -n 2048 && \ locale-gen en_US.UTF-8 && \ \ - su -u "$DOCKER_USER" wget -O linuxgsm.sh https://linuxgsm.sh && \ - su -u "$DOCKER_USER" chmod +x linuxgsm.sh && \ - su -u "$DOCKER_USER" bash linuxgsm.sh gmodserver - + wget -O "$STEAM_PATH/linuxgsm.sh" "https://linuxgsm.sh" && \ + chown "$DOCKER_USER:$DOCKER_USER" "$STEAM_PATH/linuxgsm.sh" && \ + chmod +x "$STEAM_PATH/linuxgsm.sh" + USER "$USER_ID:$GROUP_ID" VOLUME "$SERVER_PATH" diff --git a/entrypoint.sh b/entrypoint.sh index 4dbf41f..530ad77 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,13 +1,28 @@ #!/bin/bash +sleep 5s echo "starting entrypoint.sh" set -e + +cd "$STEAM_PATH" + parms="-game garrysmod +gamemode terrortown "$(printf "%s " "$@") echo "starting with $parms" -./gmodserver install + +ls -lA + +if [ -e "${STEAM_PATH}/gmodserver" ]; then + ./gmodserver update-lgsm + ./gmodserver update +else + bash linuxgsm.sh gmodserver + ./gmodserver auto-install +fi + trap './home/steam/gmodserver stop' SIGTERM -./gmodserver debug +./gmodserver start +./gmodserver console wait "$!"