From 14611dc2a49e7354feaafc836efdd1fab051dd9e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 15 Dec 2016 04:55:16 +0100 Subject: [PATCH] Initialize path config --- Dockerfile | 3 +-- config.ini | 4 ++++ start.sh | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 config.ini diff --git a/Dockerfile b/Dockerfile index e4a2307..25ececc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,7 @@ RUN set -ex \ && useradd -d /opt/factorio -M -u 10000 factorio \ && tar -C /opt -x -z -f /tmp/factorio.tgz \ && chown -R factorio:factorio /opt/factorio \ - && rm /tmp/factorio.tgz \ - && sed -i "s;^write-data=.*$;write-data=/data;" /opt/factorio/config/config.ini + && rm /tmp/factorio.tgz USER factorio diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..e53291c --- /dev/null +++ b/config.ini @@ -0,0 +1,4 @@ +[path] +read-data=__PATH__executable__/../../data +write-data=/data + diff --git a/start.sh b/start.sh index 5b515df..0c8b652 100755 --- a/start.sh +++ b/start.sh @@ -6,6 +6,11 @@ ACTION=$1 BINARY="/opt/factorio/bin/x64/factorio" MAP_FILE="mapfile.zip" +if ! [ -e /opt/factorio/config/config.ini ]; then + mkdir -p /opt/factorio/config + cp /opt/defaults/config.ini /opt/factorio/config/config.ini +fi + case ${ACTION} in "init") echo "Initializing files in case they do not exist: map-gen-settings.json / server-settings.json"