1
0
mirror of https://github.com/bplein/factorio-docker.git synced 2025-01-10 03:16:41 +02:00

#197: Enable envsubst - README

This commit is contained in:
deveth0 2019-03-05 13:05:27 +01:00
parent 70c402b9dd
commit 3ef8c5309e

View File

@ -182,6 +182,31 @@ Create file `config/server-adminlist.json` and add the adminlisted users.
"friend"
]
## Customize configuration files
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.
Example for 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 "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).