From d62bc29f2d50077e1db3fb19c792e764481ddc01 Mon Sep 17 00:00:00 2001 From: Paul Scheunemann Date: Sun, 30 Apr 2017 21:58:44 +0200 Subject: [PATCH] initial commit --- Dockerfile | 18 ++++++++++++++ bin/entrypoint.sh | 10 ++++++++ default-config.json | 60 +++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 12 +++++++++ 4 files changed, 100 insertions(+) create mode 100644 Dockerfile create mode 100755 bin/entrypoint.sh create mode 100644 default-config.json create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6fffdf6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM debian:jessie +EXPOSE 34197/udp + +RUN \ + apt-get --yes update &&\ + apt-get --yes install wget xz-utils &&\ + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +WORKDIR /root/ +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 + +ADD bin/entrypoint.sh /entrypoint.sh +ADD default-config.json config/default.json + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["--server-settings", "config/default.json"] diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh new file mode 100755 index 0000000..f367491 --- /dev/null +++ b/bin/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +FACTORIO_BIN=/root/factorio/bin/x64/factorio +WORLDNAME=/root/saves/world.zip + +# Create savefile, if none exists +[ ! -f ${WORLDNAME} ] && ${FACTORIO_BIN} --create ${WORLDNAME} + +exec ${FACTORIO_BIN} --start-server ${WORLDNAME} "$@" diff --git a/default-config.json b/default-config.json new file mode 100644 index 0000000..7d2128e --- /dev/null +++ b/default-config.json @@ -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": 10, + + "_comment_visibility": ["public: Game will be published on the official Factorio matching server", + "lan: Game will be broadcast on LAN"], + "visibility": + { + "public": false, + "lan": true + }, + + "_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": [] +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..368e474 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" + +services: + factorio: + build: . + ports: + - 34197:34197/udp + volumes: + - world:/root/saves/ + +volumes: + world: