Skip to content

Commit

Permalink
tet
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jun 12, 2024
1 parent 27662d6 commit a346c51
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 29 deletions.
36 changes: 9 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Use the latest version of Ubuntu as the base image
FROM ubuntu:latest

# Define variables for the username and volume directory
# Define variables for the username, volume directory, and game
ENV USERNAME=steam
ENV VOLUME_DIR=src
ENV GAME=hlds

# Update the base image and install dependencies
RUN dpkg --add-architecture i386 && \
Expand All @@ -24,37 +25,18 @@ USER $USERNAME
# Set the working directory
WORKDIR /opt/$USERNAME

# Copy the installation script for HLDM
COPY ./hldm.install /opt/$USERNAME
# Copy the installation script for the game
COPY ./hlds.txt /opt/$USERNAME

# Download SteamCMD and install HLDM
# Download SteamCMD and install the game
RUN curl -v -sL media.steampowered.com/client/installer/steamcmd_linux.tar.gz | tar xzvf - && \
file /opt/$USERNAME/linux32/steamcmd && \
./steamcmd.sh +runscript hldm.install
./steamcmd.sh +runscript hlds.txt

# Fix the error that steamclient.so is missing
RUN mkdir -p $HOME/.steam && \
ln -s /opt/$USERNAME/linux32 $HOME/.steam/sdk32 && \
echo 70 > /opt/$USERNAME/hldm/steam_appid.txt
echo 70 > /opt/$USERNAME/$GAME/steam_appid.txt

# Set the working directory for HLDM
WORKDIR /opt/$USERNAME/hldm

# Copy configs, Metamod, Stripper2, and AMX
COPY --chown=$USERNAME:$USERNAME $VOLUME_DIR valve
COPY --chown=$USERNAME:$USERNAME ./entrypoint.sh ./entrypoint.sh

# Expose the necessary ports
EXPOSE 27015
EXPOSE 27015/udp

# Set the entrypoint for the server
ENTRYPOINT ["./entrypoint.sh", "-timeout 3"]

# Set the default start parameters
CMD ["+maxplayers 12", "+map crossfire"]

# Set labels for the image
LABEL vendor=steamcalculator.com \
hldm.docker.version="$VERSION" \
hldm.docker.release-date="$RELEASE_DATE"
# Set the working directory for the game
WORKDIR /opt/$USERNAME/$GAME
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [ -d /tmp/gamedir ]
then
rsync --chown=steam:steam /tmp/gamedir/* /opt/steam/hldm/valve
rsync --chown=steam:steam /tmp/gamedir/* /opt/steam/cstrike/valve
fi

export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
Expand Down
2 changes: 1 addition & 1 deletion hldm.install → hlds.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@ShutdownOnFailedCommand 0
@NoPromptForPassword 1
login anonymous
force_install_dir ./hldm
force_install_dir ./cstrike
app_set_config 90 mod valve
app_update 90
app_update 90 validate
Expand Down

0 comments on commit a346c51

Please sign in to comment.