Skip to content

Instantly share code, notes, and snippets.

@AkashiSN
Last active April 8, 2020 04:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkashiSN/5a95aad35778155bb84d2a04148a144b to your computer and use it in GitHub Desktop.
Save AkashiSN/5a95aad35778155bb84d2a04148a144b to your computer and use it in GitHub Desktop.
7 Days to Die Dedicated Server in Docker
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NOWARNINGS=yes
RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository multiverse \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y lib32gcc1 wget
RUN wget "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz"
RUN tar -zxf steamcmd_linux.tar.gz -C /usr/local/bin
RUN steamcmd.sh \
+login anonymous \
+force_install_dir /root/server \
+app_update 294420 \
+quit
RUN mkdir -p /root/.local/share/7DaysToDie/Saves
COPY serverconfig.xml /root/server
EXPOSE 8080/tcp 8081/tcp
EXPOSE 26900-26902 26900-26902/udp
CMD export LD_LIBRARY_PATH=/root/server && \
/root/server/7DaysToDieServer.x86_64 \
-configfile=/root/server/serverconfig.xml \
-logfile /root/server/output.log \
-quit -batchmode -nographics -dedicated $@
build:
docker build --tag "7daysserver:latest" .
run:
docker run -itd --name "7days-docker" -v "./Saves:/root/.local/share/7DaysToDie/Saves" -p 26900-26902:26900-26902/udp -p 18500:8080 7daysserver:latest
start:
docker start 7days-docker
stop:
docker stop 7days-docker
backup:
docker cp 7days-docker:/root/.local/share/7DaysToDie/Saves .
logs:
docker cp 7days-docker:/root/server/output.log .
cat output.log
rm -rf output.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment