├── update.sh ├── server.cfg ├── csgo_ds.txt ├── tf2_ds.txt ├── Makefile ├── csgo.sh ├── autoexec.cfg ├── LICENSE.md ├── Dockerfile └── README.md /update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd $HOME/hlserver 3 | ./steamcmd.sh +runscript csgo_ds.txt 4 | -------------------------------------------------------------------------------- /server.cfg: -------------------------------------------------------------------------------- 1 | sv_maxrate 0 2 | sv_minrate 30000 3 | sv_maxcmdrate 128 4 | sv_mincmdrate 128 5 | -------------------------------------------------------------------------------- /csgo_ds.txt: -------------------------------------------------------------------------------- 1 | login anonymous 2 | force_install_dir ./csgo 3 | app_update 740 validate 4 | quit 5 | -------------------------------------------------------------------------------- /tf2_ds.txt: -------------------------------------------------------------------------------- 1 | login anonymous 2 | force_install_dir ./tf2 3 | app_update 232250 validate 4 | quit 5 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build 2 | build: 3 | docker build -t gonzih/csgo-server . 4 | 5 | .PHONY: push 6 | push: build 7 | docker push gonzih/csgo-server 8 | -------------------------------------------------------------------------------- /csgo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd $HOME/hlserver 3 | csgo/srcds_run -game csgo -tickrate 128 -autoupdate -steam_dir ~/hlserver -steamcmd_script ~/hlserver/csgo_ds.txt $@ 4 | -------------------------------------------------------------------------------- /autoexec.cfg: -------------------------------------------------------------------------------- 1 | log on //This is set to turn on logging! Don't put this in your server.cfg 2 | hostname "Counter-Strike: Global Offensive Dedicated Server" 3 | //rcon_password "yourrconpassword" 4 | sv_password "" //Only set this if you intend to have a private server! 5 | sv_cheats 0 //This should always be set, so you know it's not on 6 | sv_lan 0 //This should always be set, so you know it's not on 7 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright © `2018-2019` `Max Gonzih gonzih @ gmail.com` 5 | 6 | Permission is hereby granted, free of charge, to any person 7 | obtaining a copy of this software and associated documentation 8 | files (the “Software”), to deal in the Software without 9 | restriction, including without limitation the rights to use, 10 | copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the 12 | Software is furnished to do so, subject to the following 13 | conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 20 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 25 | OTHER DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | MAINTAINER Max Gonzih 3 | 4 | ENV USER csgo 5 | ENV HOME /home/$USER 6 | ENV SERVER $HOME/hlserver 7 | 8 | RUN apt-get -y update \ 9 | && apt-get -y upgrade \ 10 | && apt-get -y install lib32gcc1 curl net-tools lib32stdc++6 locales \ 11 | && locale-gen en_US.UTF-8 \ 12 | && update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 \ 13 | && dpkg-reconfigure --frontend=noninteractive locales \ 14 | && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ 15 | && useradd $USER \ 16 | && mkdir $HOME \ 17 | && chown $USER:$USER $HOME \ 18 | && mkdir $SERVER 19 | 20 | ENV LC_ALL en_US.UTF-8 21 | ENV LANG en_US.UTF-8 22 | ENV LANGUAGE en_US.UTF-8 23 | 24 | ADD ./csgo_ds.txt $SERVER/csgo_ds.txt 25 | ADD ./update.sh $SERVER/update.sh 26 | ADD ./autoexec.cfg $SERVER/csgo/csgo/cfg/autoexec.cfg 27 | ADD ./server.cfg $SERVER/csgo/csgo/cfg/server.cfg 28 | ADD ./csgo.sh $SERVER/csgo.sh 29 | 30 | RUN chown -R $USER:$USER $SERVER 31 | 32 | USER $USER 33 | RUN curl http://media.steampowered.com/client/steamcmd_linux.tar.gz | tar -C $SERVER -xvz \ 34 | && $SERVER/update.sh 35 | 36 | EXPOSE 27015/udp 37 | 38 | WORKDIR /home/$USER/hlserver 39 | ENTRYPOINT ["./csgo.sh"] 40 | CMD ["-console" "-usercon" "+game_type" "0" "+game_mode" "1" "+mapgroup" "mg_active" "+map" "de_cache"] 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Counter Strike Global Offensive + Docker 2 | 3 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/Gonzih/docker-csgo-server/blob/master/LICENSE.md) 4 | 5 | CS:GO server in docker with 128 tick enabled by default. 6 | 7 | ### Docker hub image 8 | 9 | ```shell 10 | docker pull gonzih/csgo-server 11 | ``` 12 | 13 | ### Details: 14 | By default image is build with enabled autoupdate feature (take a look at `csgo.sh` file). 15 | You can create new Dockerfile based on that image (FROM csgo) and customize it with plugins, configs, CMD and ENTRYPOINT instructions. 16 | 17 | ```shell 18 | # Build image and tag it as csgo 19 | docker build -t csgo github.com/Gonzih/docker-csgo-server 20 | 21 | # Run image with default options (CMD in Dockerfile) 22 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo 23 | 24 | # Run image with as Classic Casual server 25 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_cache 26 | 27 | # Run image with as Classic Competetive server 28 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_cache 29 | 30 | # Run image with as Arm Race server 31 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo -console -usercon +game_type 1 +game_mode 0 +mapgroup mg_armsrace +map ar_shoots 32 | 33 | # Run image with as Demolition server 34 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo -console -usercon +game_type 1 +game_mode 1 +mapgroup mg_demolition +map de_lake 35 | 36 | # Run image with as Deathmatch server 37 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo -console -usercon +game_type 1 +game_mode 2 +mapgroup mg_allclassic +map de_dust 38 | 39 | # To run lan server just add `+sv_lan 1` at end of command 40 | docker run -d -p 27015:27015 -p 27015:27015/udp csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_cache +sv_lan 1 41 | ``` 42 | 43 | ### Running public server 44 | 45 | To run public server you need to [Register Login Token](http://steamcommunity.com/dev/managegameservers) and adding `+sv_setsteamaccount THISGSLTHERE -net_port_try 1` to the server command. 46 | Refer to [Docs](https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers#Registering_Game_Server_Login_Token) for more details. 47 | --------------------------------------------------------------------------------