Skip to content

Commit

Permalink
update Dockerfile entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusraupach committed Jan 9, 2025
1 parent 2721ea8 commit 836b4df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
47 changes: 18 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,57 +1,46 @@
FROM cm2network/steamcmd
FROM cm2network/steamcmd:latest

ENV DOORSTOP_ENABLE=TRUE
ENV DOORSTOP_INVOKE_DLL_PATH=/home/steam/valheim-dedicated-server/BepInEx/core/BepInEx.Preloader.dll
ENV DOORSTOP_CORLIB_OVERRIDE_PATH=/home/steam/valheim-dedicated-server/unstripped_corlib
ARG STEAM_APP_ID=892970
ARG SERVER_DIR=/home/steam/valheim-dedicated-server

ENV LD_LIBRARY_PATH="/home/steam/valheim-dedicated-server/doorstop_libs:/home/steam/valheim-dedicated-server/linux64:$LD_LIBRARY_PATH"
ENV LD_PRELOAD="/home/steam/valheim-dedicated-server/doorstop_libs/libdoorstop_x64.so:$LD_PRELOAD"

ENV SteamAppID=892970
ENV DOORSTOP_ENABLE=TRUE \

Check warning on line 6 in Dockerfile

View workflow job for this annotation

GitHub Actions / build

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$LD_LIBRARY_PATH' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
DOORSTOP_INVOKE_DLL_PATH=${SERVER_DIR}/BepInEx/core/BepInEx.Preloader.dll \
DOORSTOP_CORLIB_OVERRIDE_PATH=${SERVER_DIR}/unstripped_corlib \
LD_LIBRARY_PATH="${SERVER_DIR}/doorstop_libs:${SERVER_DIR}/linux64:$LD_LIBRARY_PATH" \
SteamAppID=${STEAM_APP_ID}

USER root

WORKDIR /

RUN apt-get update \
&& apt-get install -y \
RUN apt-get update && apt-get install -y \
libatomic1 \
libpulse-dev \
libpulse0 \
&& rm -rf /var/lib/apt/lists/*

COPY entrypoint.sh .
COPY --chown=steam:steam entrypoint.sh /

RUN chmod +x entrypoint.sh
RUN chmod +x /entrypoint.sh

USER steam

WORKDIR /home/steam/steamcmd

RUN mkdir -p /home/steam/valheim-dedicated-server \
RUN mkdir -p ${SERVER_DIR} \
&& ./steamcmd.sh +@sSteamCmdForcePlatformType linux \
+force_install_dir /home/steam/valheim-dedicated-server \
+force_install_dir ${SERVER_DIR} \
+login anonymous \
+app_update 896660 validate \
+quit

USER root

WORKDIR /home/steam/valheim-dedicated-server

COPY BepInEx/BepInExPack_Valheim/BepInEx/ ./BepInEx/
COPY BepInEx/BepInExPack_Valheim/doorstop_libs/ ./doorstop_libs/

RUN chown -R steam:steam BepInEx/ && \
chown -R steam:steam doorstop_libs/ && \
chmod +x doorstop_libs/libdoorstop_x64.so

USER steam
COPY --chown=steam:steam BepInEx/BepInExPack_Valheim/BepInEx/ ${SERVER_DIR}/BepInEx/
COPY --chown=steam:steam BepInEx/BepInExPack_Valheim/doorstop_libs/ ${SERVER_DIR}/doorstop_libs/

WORKDIR /

EXPOSE 2456-2458/udp

VOLUME ["/home/steam/Valheim"]

ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["/entrypoint.sh"]

CMD []
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

export LD_PRELOAD="/home/steam/valheim-dedicated-server/doorstop_libs/libdoorstop_x64.so:$LD_PRELOAD"

: "${NAME:=""}"
: "${WORLD:=""}"
: "${PASSWORD:="Secret"}"
Expand Down

0 comments on commit 836b4df

Please sign in to comment.