diff --git a/0.17/Dockerfile b/0.17/Dockerfile index b10e6fa..9824664 100644 --- a/0.17/Dockerfile +++ b/0.17/Dockerfile @@ -41,6 +41,6 @@ EXPOSE $PORT/udp $RCON_PORT/tcp COPY files/ / -USER $USER +#USER $USER ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/0.17/files/docker-entrypoint.sh b/0.17/files/docker-entrypoint.sh old mode 100644 new mode 100755 index 3aee1b8..db7f900 --- a/0.17/files/docker-entrypoint.sh +++ b/0.17/files/docker-entrypoint.sh @@ -3,6 +3,8 @@ set -e id +FACTORIO_VOL=/factorio +mkdir -p $FACTORIO_VOL mkdir -p $SAVES mkdir -p $CONFIG mkdir -p $MODS @@ -36,7 +38,11 @@ if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then --map-settings $CONFIG/map-settings.json fi -exec /opt/factorio/bin/x64/factorio \ +if [ "$(id -u)" = '0' ]; then + chown -R factorio:factorio $FACTORIO_VOL +fi + +exec gosu factorio /opt/factorio/bin/x64/factorio \ --port $PORT \ --start-server-load-latest \ --server-settings $CONFIG/server-settings.json \ diff --git a/0.17/files/scenario.sh b/0.17/files/scenario.sh old mode 100644 new mode 100755 diff --git a/0.17/files/scenario2map.sh b/0.17/files/scenario2map.sh old mode 100644 new mode 100755