Skip to content

Instantly share code, notes, and snippets.

@AkashiSN
Last active Apr 8, 2020
Embed
What would you like to do?
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