specify location of settings

This commit is contained in:
David Andersen 2016-10-25 21:57:49 -07:00
parent 44f5ffd6b4
commit 16602ba40b
4 changed files with 34 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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"}
}
}

1
run.sh
View File

@ -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 \