mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2024-11-07 11:17:23 +01:00
commit
ff6f4b6cd0
@ -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 && \
|
||||
|
25
README.md
25
README.md
@ -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).
|
||||
|
Loading…
Reference in New Issue
Block a user