init_project

This commit is contained in:
2026-09-06 01:25:18 +03:00
commit a816b838d9
7 changed files with 281 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
FROM debian:bookworm-slim
ARG FACTORIO_VERSION
ENV FACTORIO_HOME=/opt/factorio \
FACTORIO_DATA=/factorio
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
xz-utils \
libstdc++6 \
libgcc-s1 \
sudo; \
rm -rf /var/lib/apt/lists/*; \
test -n "${FACTORIO_VERSION}"; \
mkdir -p /opt; \
curl -fL \
"https://factorio.com/get-download/${FACTORIO_VERSION}/headless/linux64" \
-o /tmp/factorio.tar.xz; \
tar -xJf /tmp/factorio.tar.xz -C /opt; \
rm -f /tmp/factorio.tar.xz; \
useradd \
--create-home \
--uid 1000 \
--shell /bin/bash \
factorio; \
mkdir -p \
"${FACTORIO_DATA}/saves" \
"${FACTORIO_DATA}/mods" \
"${FACTORIO_DATA}/config"; \
chown -R factorio:factorio \
"${FACTORIO_HOME}" \
"${FACTORIO_DATA}"
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh && chown factorio:factorio /entrypoint.sh
WORKDIR ${FACTORIO_DATA}
USER factorio
VOLUME ["/factorio"]
EXPOSE 34197/udp
EXPOSE 27015/tcp
ENTRYPOINT ["/entrypoint.sh"]
CMD ["--start-server", "/factorio/saves/world.zip", "--server-settings", "/factorio/config/server-settings.json"]