1
0
mirror of https://github.com/bplein/factorio-docker.git synced 2024-11-24 08:42:31 +02:00

set rcon password

This commit is contained in:
David Andersen 2016-10-31 19:59:57 +00:00
parent 833de3cc46
commit b53d98cb2a
2 changed files with 8 additions and 2 deletions

View File

@ -7,7 +7,7 @@ COPY ./factorio.crt /opt/factorio.crt
ENV VERSION=0.14.17 \
SHA1=ffb248fabed345aafadb6a8cdef3684312ac240f
RUN apk --update --no-cache add bash curl tini && \
RUN apk --update --no-cache add bash curl tini pwgen && \
curl -sSL --cacert /opt/factorio.crt \
https://www.factorio.com/get-download/$VERSION/headless/linux64 \
-o /tmp/factorio_headless_x64_$VERSION.tar.gz && \

View File

@ -8,6 +8,10 @@ mkdir -p /factorio/saves
mkdir -p /factorio/mods
mkdir -p /factorio/config
if [ ! -f /factorio/config/rconpw ]; then
echo $(pwgen 15 1) > /factorio/config/rconpw
fi
if [ ! -f /factorio/config/server-settings.json ]; then
cp /opt/factorio/data/server-settings.example.json /factorio/config/server-settings.json
fi
@ -25,4 +29,6 @@ fi
exec /opt/factorio/bin/x64/factorio \
--port 34197 \
--start-server-load-latest \
--server-settings /opt/factorio/data/server-settings.json
--server-settings /opt/factorio/data/server-settings.json \
--rcon-port 27015 \
--rcon-password "$(cat /factorio/config/rconpw)"