1
0
mirror of https://github.com/LpmRaven/factorio-docker-server.git synced 2024-12-12 08:24:07 +02:00

custom settings and map settings added

This commit is contained in:
Liam Raven 2016-12-17 21:31:42 +00:00
parent 66ec9c9d1b
commit c253421ea1
5 changed files with 86 additions and 3 deletions

View File

@ -13,6 +13,8 @@ USER factorio
ENV HOME /opt/factorio ENV HOME /opt/factorio
ENV SAVEFILE /opt/factorio/saves/factorio_save.zip ENV SAVEFILE /opt/factorio/saves/factorio_save.zip
ENV MAPSETTINGS /opt/factorio/map-gen-settings.json
ENV SERVERSETTINGS /opt/factorio/server-settings.json
WORKDIR /opt/factorio WORKDIR /opt/factorio
@ -20,6 +22,8 @@ RUN wget -q -O - https://www.factorio.com/download-headless/stable | grep -o -m
&& tar -xzf /tmp/factorio.tar.gz -C /opt \ && tar -xzf /tmp/factorio.tar.gz -C /opt \
&& rm -rf /tmp/factorio.tar.gz && rm -rf /tmp/factorio.tar.gz
ADD map-gen-settings.json /opt/factorio/
ADD server-settings.json /opt/factorio/
ADD init.sh /opt/factorio/ ADD init.sh /opt/factorio/
EXPOSE 34197/udp EXPOSE 34197/udp

View File

@ -31,7 +31,7 @@ Windows users will need to look at alterations for using PuTTY.
# Build Your Factorio Headless Server # Build Your Factorio Headless Server
The latest Factorio headless server is downloaded at build time. This may be a good reason you want to build your own image since the Docker Hub repo may not always be up to date. The latest Factorio headless server is downloaded at build time.
1. `git clone https://github.com/LpmRaven/docker-factorio.git` 1. `git clone https://github.com/LpmRaven/docker-factorio.git`
2. `docker build -t factorio-instance-name .` 2. `docker build -t factorio-instance-name .`

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [ ! -f $SAVEFILE ]; then if [ ! -f $SAVEFILE ]; then
/opt/factorio/bin/x64/factorio --create $SAVEFILE /opt/factorio/bin/x64/factorio --create $SAVEFILE --map-gen-settings $MAPSETTINGS
fi fi
/opt/factorio/bin/x64/factorio --start-server $SAVEFILE /opt/factorio/bin/x64/factorio --start-server $SAVEFILE --server-settings $SERVERSETTINGS

19
map-gen-settings.json Normal file
View File

@ -0,0 +1,19 @@
{
"_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": "low", "size": "normal", "richness": "normal"},
"copper-ore": {"frequency": "low", "size": "normal", "richness": "normal"},
"crude-oil": {"frequency": "low", "size": "high", "richness": "normal"},
"enemy-base": {"frequency": "very-high", "size": "very-high", "richness": "very-high"},
"iron-ore": {"frequency": "low", "size": "normal", "richness": "normal"},
"stone": {"frequency": "low", "size": "normal", "richness": "normal"}
}
}

60
server-settings.json Normal file
View File

@ -0,0 +1,60 @@
{
"name": "Name of the game as it will appear in the game listing",
"description": "Description of the game that will appear in the listing",
"tags": ["game", "tags"],
"_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.",
"max_players": 0,
"_comment_visibility": ["public: Game will be published on the official Factorio matching server",
"lan: Game will be broadcast on LAN"],
"visibility":
{
"public": false,
"lan": false
},
"_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public",
"username": "",
"password": "",
"_comment_token": "Authentication token. May be used instead of 'password' above.",
"token": "",
"game_password": "",
"_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account",
"require_user_verification": true,
"_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.",
"max_upload_in_kilobytes_per_second": 0,
"_comment_minimum_latency_in_ticks": "optional one tick is 16ms in default speed, default value is 0. 0 means no minimum.",
"minimum_latency_in_ticks": 0,
"_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.",
"ignore_player_limit_for_returning_players": false,
"_comment_allow_commands": "possible values are, true, false and admins-only",
"allow_commands": "admins-only",
"_comment_autosave_interval": "Autosave interval in minutes",
"autosave_interval": 10,
"_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.",
"autosave_slots": 5,
"_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.",
"afk_autokick_interval": 0,
"_comment_auto_pause": "Whether should the server be paused when no players are present.",
"auto_pause": true,
"only_admins_can_pause_the_game": true,
"_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.",
"autosave_only_on_server": true,
"_comment_admins": "List of case insensitive usernames, that will be promoted immediately",
"admins": []
}