-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (21 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM debian:12-slim AS env-build
RUN apt-get update && apt-get install -y curl xz-utils
ARG FACTORIO_VERSION=1.1.109
ARG FACTORIO_SHA256="105a38533c916fe66e2fb2b9fe8f93c116568047a20c4daa74632072c077bf3f"
RUN curl -A "Mozilla/5.0 (Windows NT 10.0; rv:100.0) Gecko/20100101 Firefox/100.0" \
-LO https://www.factorio.com/get-download/${FACTORIO_VERSION}/headless/linux64 \
&& echo "${FACTORIO_SHA256} linux64" | sha256sum -c -
COPY settings/ /
RUN tar -xf linux64 && /factorio/bin/x64/factorio \
--map-gen-settings map-gen-settings.json \
--map-settings map-settings.json \
--create build-server.zip
FROM gcr.io/distroless/cc-debian12:nonroot AS env-deploy
COPY --from=env-build /factorio/bin/x64/factorio /bin
COPY --from=env-build /factorio/data /usr/share/factorio
USER nonroot
WORKDIR /home/nonroot
EXPOSE 34197/udp
COPY --from=env-build --chown=nonroot build-server.zip /home/nonroot
COPY --from=env-build --chown=nonroot server-settings.json /home/nonroot
CMD [ "factorio", "--start-server", "build-server.zip", "--server-settings", "server-settings.json" ]