Created
January 27, 2019 00:16
-
-
Save Nuc1eoN/9bfda1f0b8b9caec61da545847e7ca20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM debian:stretch | |
LABEL maintainer="[email protected]" | |
# Install Dependencies, clean cache, install locale to prevent errors and create new home directory | |
# While srcds_run uses bash specific extensions, it is stupidly configured to run from /bin/sh. That's why /bin/sh is recommended to point to bash at this point. | |
RUN apt-get update && apt-get install --no-install-recommends -y \ | |
lib32stdc++6 \ | |
lib32gcc1 \ | |
ca-certificates \ | |
locales \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ | |
&& locale-gen \ | |
# && ln -sf bash /bin/sh \ | |
&& useradd -m steam | |
USER steam | |
# Install SteamCMD | |
RUN mkdir /home/steam/steamcmd | |
WORKDIR /home/steam/steamcmd | |
ADD --chown=steam https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz steamcmd_linux.tar.gz | |
USER root | |
RUN chown -R steam:steam steamcmd_linux.tar.gz | |
USER steam | |
RUN tar -zxf steamcmd_linux.tar.gz && rm steamcmd_linux.tar.gz | |
# Install CSGO | |
# NOTE: steamcmd REQUIRES an absolute path | |
RUN ./steamcmd.sh +login anonymous +force_install_dir /home/steam/csgo-dedicated +app_update 740 validate +quit | |
# Fix for missing library | |
RUN mkdir /home/steam/.steam/sdk32 \ | |
&& ln -s /home/steam/steamcmd/linux32/steamclient.so /home/steam/.steam/sdk32/steamclient.so | |
# Create convinient environment variables | |
ENV IP=0.0.0.0 \ | |
PORT=27015 \ | |
TV_PORT=27020 \ | |
REGION=3 \ | |
TICKRATE=128 \ | |
FPSMAX=300 \ | |
MAXPLAYERS=14 \ | |
TOKEN=changeme \ | |
HOSTNAME=changeme \ | |
RCON_PW=changeme \ | |
SV_PW=changeme \ | |
MAPGROUP=mg_active \ | |
GAME_TYPE=0 \ | |
GAME_MODE=1 \ | |
MAP=de_dust2 | |
WORKDIR /home/steam/csgo-dedicated | |
# Start server | |
ENTRYPOINT LD_LIBRARY_PATH=/home/steam/csgo-dedicated/bin:/home/steam/csgo-dedicated \ | |
./srcds_linux \ | |
-game csgo \ | |
-autoupdate \ | |
-console \ | |
-usercon \ | |
-port $PORT \ | |
+ip $IP \ | |
-tv_port $TV_PORT \ | |
+sv_region $REGION \ | |
-tickrate $TICKRATE \ | |
+fps_max $FPSMAX \ | |
-maxplayers_override $MAXPLAYERS \ | |
+sv_setsteamaccount $TOKEN \ | |
+hostname $HOSTNAME \ | |
+rcon_password $RCON_PW \ | |
+sv_password $SV_PW \ | |
+mapgroup $MAPGROUP \ | |
+game_type $GAME_TYPE \ | |
+game_mode $GAME_MODE \ | |
+map $MAP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment