- Dockerfile now only installs SteamCMD, server downloaded on first run - Entrypoint handles full server installation including addons - Fixed volume configuration for persistence - Added AUTO_UPDATE environment variable
84 lines
2.3 KiB
Docker
84 lines
2.3 KiB
Docker
#===============================================================================
|
|
# Garry's Mod PropHunt Server - Docker Image
|
|
# Repository: https://git.vish.gg/Vish/gmod-prophunt-server
|
|
#
|
|
# This Dockerfile downloads GMod server at runtime for better compatibility
|
|
#===============================================================================
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
LABEL maintainer="Vish <dvish92@gmail.com>"
|
|
LABEL description="Garry's Mod PropHunt Dedicated Server"
|
|
LABEL version="1.0"
|
|
|
|
# Environment variables
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
GMOD_INSTALL_DIR=/home/gmod \
|
|
SERVER_DIR=/home/gmod/serverfiles \
|
|
STEAMCMD_DIR=/home/gmod/steamcmd \
|
|
SRCDS_TOKEN="" \
|
|
SERVER_NAME="PropHunt Server" \
|
|
RCON_PASSWORD="changeme" \
|
|
MAX_PLAYERS="24" \
|
|
MAP="gm_construct" \
|
|
PORT="27015" \
|
|
GAMEMODE="prop_hunt" \
|
|
WORKSHOP_COLLECTION="" \
|
|
TICKRATE="66" \
|
|
TZ="America/Los_Angeles" \
|
|
AUTO_UPDATE="true"
|
|
|
|
# Install dependencies
|
|
RUN dpkg --add-architecture i386 && \
|
|
apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
wget \
|
|
tar \
|
|
unzip \
|
|
lib32gcc-s1 \
|
|
lib32stdc++6 \
|
|
locales \
|
|
tzdata && \
|
|
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
|
|
locale-gen && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV LANG=en_US.UTF-8 \
|
|
LANGUAGE=en_US:en \
|
|
LC_ALL=en_US.UTF-8
|
|
|
|
# Create user and directories
|
|
RUN useradd -m -s /bin/bash gmod && \
|
|
mkdir -p /home/gmod/serverfiles /home/gmod/steamcmd && \
|
|
chown -R gmod:gmod /home/gmod
|
|
|
|
# Switch to gmod user
|
|
USER gmod
|
|
WORKDIR /home/gmod
|
|
|
|
# Install SteamCMD only (server downloaded at runtime)
|
|
RUN cd /home/gmod/steamcmd && \
|
|
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - && \
|
|
./steamcmd.sh +quit
|
|
|
|
# Copy configuration and entrypoint
|
|
COPY --chown=gmod:gmod cfg/ /home/gmod/cfg-template/
|
|
COPY --chown=gmod:gmod scripts/docker-entrypoint.sh /home/gmod/entrypoint.sh
|
|
|
|
USER root
|
|
RUN chmod +x /home/gmod/entrypoint.sh
|
|
USER gmod
|
|
|
|
# Expose ports
|
|
EXPOSE 27015/tcp 27015/udp 27005/udp 27020/udp
|
|
|
|
# Volumes for persistent data
|
|
VOLUME ["/home/gmod/serverfiles"]
|
|
|
|
WORKDIR /home/gmod
|
|
|
|
ENTRYPOINT ["/home/gmod/entrypoint.sh"]
|