Last active
April 8, 2020 04:33
-
-
Save AkashiSN/5a95aad35778155bb84d2a04148a144b to your computer and use it in GitHub Desktop.
7 Days to Die Dedicated Server in Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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