From 16602ba40b220c2d12883caa33d1024a5339cdae Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 21:57:49 -0700 Subject: [PATCH] specify location of settings --- Dockerfile | 4 +++- docker-entrypoint.sh | 8 ++++++-- map-gen-settings.example.json | 24 ++++++++++++++++++++++++ run.sh | 1 + 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 map-gen-settings.example.json diff --git a/Dockerfile b/Dockerfile index 50fca14..821b6a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,9 @@ RUN apk --update add bash curl && \ -o /tmp/factorio_headless_x64_$VERSION.tar.gz && \ echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c && \ tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz --directory /opt && \ - rm /tmp/factorio_headless_x64_$VERSION.tar.gz + rm /tmp/factorio_headless_x64_$VERSION.tar.gz && \ + cp /opt/factorio/data/server-settings.example.json /opt/factorio/data/server-settings.json && \ + cp /opt/factorio/data/map-gen-settings.example.json /opt/factorio/data/map-gen-settings.json VOLUME /opt/factorio/saves /opt/factorio/mods diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8040453..6294cbc 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,7 +4,11 @@ SAVES=/opt/factorio/saves if [ ! -f $SAVES/*.zip ] then - /opt/factorio/bin/x64/factorio --create $SAVES/save.zip + /opt/factorio/bin/x64/factorio \ + --create $SAVES/save.zip \ + --map-gen-settings /opt/factorio/data/map-gen-settings.json fi -exec /opt/factorio/bin/x64/factorio --start-server-load-latest +exec /opt/factorio/bin/x64/factorio \ + --start-server-load-latest \ + --server-settings /opt/factorio/data/server-settings.json diff --git a/map-gen-settings.example.json b/map-gen-settings.example.json new file mode 100644 index 0000000..a7ff667 --- /dev/null +++ b/map-gen-settings.example.json @@ -0,0 +1,24 @@ +{ + "_comment": "Sizes can be specified as none, very-low, low, normal, +high, very-high", + "terrain_segmentation": "normal", + "water": "normal", + "width": 0, + "height": 0, + "starting_area": "normal", + "peaceful_mode": false, + "autoplace_controls": + { + "coal": {"frequency": "very-low", "size": "high", "richness": "high"}, + "copper-ore": {"frequency": "very-low", "size": "high", "richness": +"high"}, + "crude-oil": {"frequency": "normal", "size": "high", "richness": +"high"}, + "enemy-base": {"frequency": "low", "size": "normal", "richness": +"normal"}, + "iron-ore": {"frequency": "very-low", "size": "high", "richness": +"high"}, + "stone": {"frequency": "very-low", "size": "normal", "richness": +"normal"} + } +} diff --git a/run.sh b/run.sh index e0805ac..76c7e6c 100755 --- a/run.sh +++ b/run.sh @@ -1,5 +1,6 @@ sudo docker run --rm -it \ -v /home/vagrant/docker_factorio_server/server-settings.json:/opt/factorio/data/server-settings.json \ + -v /home/vagrant/docker_factorio_server/map-gen-settings.json:/opt/factorio/data/map-gen-settings.json \ -v /data/mods:/opt/factorio/mods \ -v /data/saves:/opt/factorio/saves \ --name factorio \