mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-01 06:28:05 +02:00
Compare commits
43 Commits
Author | SHA1 | Date | |
---|---|---|---|
fb36aaa0d9 | |||
e22ce8989b | |||
29f3e54adf | |||
148de89c52 | |||
4fc8da6581 | |||
e6290605c7 | |||
662372a1ba | |||
82f6bdf865 | |||
c9f4510195 | |||
6602c7cf7f | |||
8be7b47c07 | |||
717275198e | |||
d68ec4fdd4 | |||
47464e0b9b | |||
23fdd4ed09 | |||
e7a6bddc1f | |||
3d9e2999b6 | |||
7b33b9f6e8 | |||
066c61fb85 | |||
303fbb5d97 | |||
3f4fd9e348 | |||
504ebfde23 | |||
f982370229 | |||
51d3845af7 | |||
889c10bd48 | |||
46f397a9bb | |||
988aa08a73 | |||
ff6f4b6cd0 | |||
ea426ca0f4 | |||
4ecb1dcb6b | |||
3ef8c5309e | |||
70c402b9dd | |||
2b434ff08f | |||
49c5dff898 | |||
35d22efc67 | |||
f1b75ac034 | |||
fbb550916c | |||
1d8be250e9 | |||
d90f45bd41 | |||
2b201fea5b | |||
b0a64e5939 | |||
ef24dad0bf | |||
69a52f2c19 |
@ -9,8 +9,8 @@ ARG PGID=845
|
||||
|
||||
ENV PORT=34197 \
|
||||
RCON_PORT=27015 \
|
||||
VERSION=0.17.3 \
|
||||
SHA1=df70827c7f3e39ee3443de4d8c10f30f71973fdf \
|
||||
VERSION=0.17.15 \
|
||||
SHA1=be8d9ff72b1302366c762254b33c1daaccf44f78 \
|
||||
SAVES=/factorio/saves \
|
||||
CONFIG=/factorio/config \
|
||||
MODS=/factorio/mods \
|
||||
@ -18,7 +18,7 @@ ENV PORT=34197 \
|
||||
SCRIPTOUTPUT=/factorio/script-output
|
||||
|
||||
RUN mkdir -p /opt /factorio && \
|
||||
apk add --update --no-cache pwgen su-exec binutils && \
|
||||
apk add --update --no-cache pwgen su-exec binutils gettext libintl && \
|
||||
apk add --update --no-cache --virtual .build-deps curl && \
|
||||
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
||||
-o /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||
|
@ -23,7 +23,6 @@ fi
|
||||
|
||||
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||
echo "{}" > $CONFIG/map-gen-settings.json
|
||||
fi
|
||||
|
||||
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||
@ -62,7 +61,6 @@ exec ${SU_EXEC} /opt/factorio/bin/x64/factorio \
|
||||
--server-whitelist $CONFIG/server-whitelist.json \
|
||||
--use-server-whitelist \
|
||||
--server-adminlist $CONFIG/server-adminlist.json \
|
||||
--server-banlist $CONFIG/server-banlist.json \
|
||||
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||
--server-id /factorio/config/server-id.json \
|
||||
"$@"
|
||||
|
48
README.md
48
README.md
@ -1,6 +1,6 @@
|
||||
# Factorio [](https://microbadger.com/images/dtandersen/factorio "Get your own image badge on microbadger.com") [](https://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
||||
|
||||
* `0.17.3`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.17/Dockerfile)
|
||||
* `0.17.15`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.17/Dockerfile)
|
||||
* `0.16.51`, `0.16`, `stable` [(0.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/Dockerfile)
|
||||
* `0.15.40`, `0.15` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
||||
* `0.14.23`, `0.14` [(0.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.14/Dockerfile)
|
||||
@ -182,6 +182,31 @@ Create file `config/server-adminlist.json` and add the adminlisted users.
|
||||
"friend"
|
||||
]
|
||||
|
||||
## Customize configuration files (0.17.x+)
|
||||
|
||||
Out-of-the box, factorio does not support environment variables inside the configuration files. A workaround is the usage of `envsubst` which generates the configuration files dynamically during startup from environment variables set in docker-compose:
|
||||
|
||||
Example which replaces the server-settings.json:
|
||||
|
||||
|
||||
factorio_1:
|
||||
image: dtanders/factorio
|
||||
ports:
|
||||
- "34197:34197/udp"
|
||||
volumes:
|
||||
- /opt/factorio:/factorio
|
||||
- ./server-settings.json:/server-settings.json
|
||||
environment:
|
||||
- INSTANCE_NAME=Your Instance's Name
|
||||
- INSTANCE_DESC=Your Instance's Description
|
||||
entrypoint: /bin/sh -c "mkdir -p /factorio/config && envsubst < /server-settings.json > /factorio/config/server-settings.json && exec /docker-entrypoint.sh"
|
||||
|
||||
The `server-settings.json` file may then contain the variable references like this:
|
||||
|
||||
"name": "${INSTANCE_NAME}",
|
||||
"description": "${INSTANCE_DESC}",
|
||||
|
||||
|
||||
# Container Details
|
||||
|
||||
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
||||
@ -195,20 +220,22 @@ The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
||||
|
||||
To keep things simple, the container uses a single volume mounted at `/factorio`. This volume stores configuration, mods, and saves.
|
||||
|
||||
The files in this volume should be owned by the factorio user, uid 845.
|
||||
|
||||
factorio
|
||||
|-- config
|
||||
| |-- map-gen-settings.json
|
||||
| |-- map-settings.json
|
||||
| |-- rconpw
|
||||
| |-- server-settings.json
|
||||
| |-- server-whitelist.json
|
||||
| |-- server-adminlist.json
|
||||
| |-- server-banlist.json
|
||||
| `-- server-adminlist.json
|
||||
| |-- server-settings.json
|
||||
| `-- server-whitelist.json
|
||||
|-- mods
|
||||
| `-- fancymod.zip
|
||||
`-- saves
|
||||
`-- _autosave1.zip
|
||||
|
||||
|
||||
## Docker Compose
|
||||
|
||||
[Docker Compose](https://docs.docker.com/compose/install/) is an easy way to run Docker containers.
|
||||
@ -280,17 +307,17 @@ sudo docker run -d \
|
||||
dtandersen/factorio
|
||||
```
|
||||
|
||||
VirtualBox users must enable Bridged networking in order for the host to be assigned an internal network IP. Enable Bridged networking in Vagrant with:
|
||||
## Vagrant
|
||||
|
||||
[Vagrant](https://www.vagrantup.com/) is a easy way to setup a virtual machine (VM) to run Docker. The [Factorio Vagrant box repository](https://github.com/dtandersen/factorio-lan-vagrant) contains a sample Vagrantfile.
|
||||
|
||||
For LAN games the VM needs an internal IP in order for clients to connect. One way to do this is with a public network. The VM uses DHCP to acquire an IP address. The VM must also forward port 34197.
|
||||
|
||||
```
|
||||
config.vm.network "public_network"
|
||||
config.vm.network "forwarded_port", guest: 34197, host: 34197
|
||||
```
|
||||
|
||||
## Vagrant
|
||||
|
||||
Vagrant is a good way for those without a Linux machine to try Docker. Check out the [Factorio Vagrant Box](https://github.com/dtandersen/factorio-lan-vagrant).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**My server is listed in the server browser, but nobody can connect**
|
||||
@ -310,6 +337,7 @@ Use the `PORT` environment variable to start the server on the a different port,
|
||||
|
||||
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
|
||||
* [Fank](https://github.com/Fankserver/docker-factorio-watchdog) - Keeper of the Factorio watchdog that keeps the version up-to-date.
|
||||
* [DBendit](https://github.com/DBendit/docker_factorio_server) - Admin list, ban list, version updates
|
||||
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Originator
|
||||
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Randomly generate RCON password
|
||||
* [gnomus](https://github.com/gnomus/docker_factorio_server) - White listing
|
||||
|
Reference in New Issue
Block a user