Files
gmod-prophunt-server/docker/Dockerfile
Vish ae6a8ffb64 Fix tcmalloc crash and add 32-bit libraries
- Added libc6-i386, libncurses5:i386, libtinfo5:i386 for Source engine
- Disabled tcmalloc via LD_PRELOAD
- Added -norestart flag for Docker environment
2026-01-19 06:55:40 +00:00

87 lines
2.4 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 including 32-bit libraries required by Source engine
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 \
libc6-i386 \
libncurses5:i386 \
libtinfo5:i386 \
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"]