Skip to content

Commit

Permalink
Restructured Dockerfile, less context-switching, less layers needed, …
Browse files Browse the repository at this point in the history
…improved security and formating, tested also backups
  • Loading branch information
jammsen committed Jan 25, 2024
1 parent bc346a7 commit 172cd91
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL org.opencontainers.image.authors="Sebastian Schmidt"
LABEL org.opencontainers.image.source="https://github.com/jammsen/docker-palworld-dedicated-server"

RUN apt-get update \
&& apt-get install -y --no-install-recommends procps xdg-user-dirs \
&& apt-get install -y --no-install-recommends --no-install-suggests procps xdg-user-dirs \
&& apt-get clean \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand All @@ -15,10 +15,21 @@ ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.
SUPERCRONIC_SHA1SUM=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b

RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic

ADD --chown=steam:steam --chmod=755 servermanager.sh /servermanager.sh
ADD --chown=steam:steam --chmod=755 backupmanager.sh /backupmanager.sh

EXPOSE 8211/udp
EXPOSE 25575/tcp

RUN mkdir /palworld \
&& chown steam:steam /palworld

VOLUME [ "/palworld" ]

USER steam

Expand All @@ -40,19 +51,4 @@ ENV DEBIAN_FRONTEND=noninteractive \
BACKUP_ENABLED=true \
BACKUP_CRON_EXPRESSION="0 * * * *"

USER root

RUN mkdir /palworld
RUN chown steam:steam /palworld

VOLUME [ "/palworld" ]

EXPOSE 8211/udp
EXPOSE 25575/tcp

ADD --chmod=777 servermanager.sh /servermanager.sh
ADD --chmod=777 backupmanager.sh /backupmanager.sh

USER steam

CMD ["/servermanager.sh"]

0 comments on commit 172cd91

Please sign in to comment.