From 78b99a6ba36ad1b02cfd90278f036b8416d0c396 Mon Sep 17 00:00:00 2001 From: Paul Scheunemann Date: Sun, 9 Jul 2017 18:33:21 +0200 Subject: [PATCH 1/3] upgrade to compose file version 2 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 368e474..c6c74e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "2" services: factorio: From 16a4872ea34bc7329689a4bb6b491e2008b58f49 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 5 Sep 2017 00:07:33 +0200 Subject: [PATCH 2/3] Update container to stretch and use factorio user instead of root --- Dockerfile | 23 ++++++++++++++++------- bin/entrypoint.sh | 10 ++++++++-- docker-compose.yml | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6fffdf6..bed37db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,27 @@ -FROM debian:jessie +FROM debian:stretch EXPOSE 34197/udp +ENV FACTORIO_VERSION 0.15.33 + +ADD bin/entrypoint.sh /entrypoint.sh + RUN \ apt-get --yes update &&\ apt-get --yes install wget xz-utils &&\ - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\ + adduser --disabled-password --gecos "" --home /opt/factorio factorio &&\ + chmod 755 /entrypoint.sh &&\ + mkdir -p /opt/factorio/headless /opt/factorio/saves &&\ + chown -R factorio /opt/factorio -WORKDIR /root/ +USER factorio RUN \ - wget -O /tmp/headless.tgz https://www.factorio.com/get-download/0.15.5/headless/linux64 &&\ - tar xfv /tmp/headless.tgz && rm /tmp/headless.tgz + wget -O /tmp/headless.tgz https://www.factorio.com/get-download/$FACTORIO_VERSION/headless/linux64 &&\ + tar xfv /tmp/headless.tgz -C /opt/factorio/headless && rm /tmp/headless.tgz -ADD bin/entrypoint.sh /entrypoint.sh -ADD default-config.json config/default.json +ADD default-config.json /opt/factorio/headless/factorio/config/default.json + +VOLUME /opt/factorio/saves ENTRYPOINT ["/entrypoint.sh"] CMD ["--server-settings", "config/default.json"] diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh index f367491..807b607 100755 --- a/bin/entrypoint.sh +++ b/bin/entrypoint.sh @@ -1,10 +1,16 @@ #!/bin/bash set -e -FACTORIO_BIN=/root/factorio/bin/x64/factorio -WORLDNAME=/root/saves/world.zip +BASE_DIR=/opt/factorio + +RUN_DIR=${BASE_DIR}/headless/factorio + +FACTORIO_BIN=${RUN_DIR}/bin/x64/factorio +WORLDNAME=${BASE_DIR}/saves/world.zip # Create savefile, if none exists [ ! -f ${WORLDNAME} ] && ${FACTORIO_BIN} --create ${WORLDNAME} +cd ${RUN_DIR} + exec ${FACTORIO_BIN} --start-server ${WORLDNAME} "$@" diff --git a/docker-compose.yml b/docker-compose.yml index c6c74e2..e179085 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: ports: - 34197:34197/udp volumes: - - world:/root/saves/ + - world:/opt/factorio/saves/ volumes: world: From e7ea96ee8418a11f9c770e3b179bd388986cdee3 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sun, 1 Oct 2017 18:21:50 +0200 Subject: [PATCH 3/3] Update factorio ti 0.15.34 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bed37db..a0c32ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM debian:stretch EXPOSE 34197/udp -ENV FACTORIO_VERSION 0.15.33 +ENV FACTORIO_VERSION 0.15.34 ADD bin/entrypoint.sh /entrypoint.sh