├── .github ├── FUNDING.yml └── workflows │ └── build.yml ├── Dockerfile └── README.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: hackebein 2 | custom: paypal.me/hackebein 3 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | push: 4 | branches: 5 | - master 6 | schedule: 7 | - cron: 0 4 * * 1 8 | jobs: 9 | latest: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Set up QEMU 14 | uses: docker/setup-qemu-action@v1 15 | - name: Set up Docker Buildx 16 | uses: docker/setup-buildx-action@v1 17 | - name: Login to DockerHub 18 | uses: docker/login-action@v1 19 | with: 20 | username: ${{ secrets.DOCKERHUB_USERNAME }} 21 | password: ${{ secrets.DOCKERHUB_TOKEN }} 22 | - name: Build and push 23 | uses: docker/build-push-action@v2 24 | with: 25 | push: 'true' 26 | platforms: linux/amd64 27 | tags: hackebein/garrysmod:latest -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM hackebein/srcds 2 | 3 | ENV \ 4 | # App 5 | APPS="4020 -validate -language en,232330 -validate -language en" \ 6 | # 7 | # API 8 | # http://steamcommunity.com/dev/apikey 9 | AUTHKEY="" \ 10 | # 11 | # Public access 12 | # automatic via API 13 | GLSTAPP="4000" \ 14 | # manual 15 | # APPID: 4000 16 | # http://steamcommunity.com/dev/managegameservers 17 | GLST="" \ 18 | # 19 | # Workshop server download (require API) 20 | WORKSHOP="\${WORKSHOPCOLLECTIONID:-}" \ 21 | # 22 | # Workshop client download (require API) 23 | WORKSHOPDL="" \ 24 | # 25 | # Server config 26 | GAME="garrysmod" \ 27 | TICKRATE="66" \ 28 | MAXPLAYERS="16" \ 29 | GAMEMODE="sandbox" \ 30 | GAMETYPE="0" \ 31 | MAP="gm_flatgrass" \ 32 | MAPGROUP="mg_active" \ 33 | CONFIG="server.cfg" \ 34 | # 35 | # Start parameters 36 | SRCDSPARAMS="\ 37 | -game \${GAME} \ 38 | -tickrate \${TICKRATE} \ 39 | -maxplayers \${MAXPLAYERS} \ 40 | -authkey \${AUTHKEY} \ 41 | +host_workshop_collection \${WORKSHOP} \ 42 | +gamemode \${GAMEMODE} \ 43 | +map \${MAP} \ 44 | +servercfgfile \${CONFIG} \ 45 | \${CUSTOMPARAMETERS} \ 46 | " 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What is Garry's Mod? 2 | 3 | Garry's Mod is a physics sandbox. There aren't any predefined aims or goals. We give you the tools and leave you to play. 4 | 5 | # Quick Start 6 | 7 | ## Basic 8 | 9 | ``` 10 | docker run -it \ 11 | -p 27015:27015/tcp \ 12 | -p 27015:27015/udp \ 13 | hackebein/garrysmod 14 | ``` 15 | 16 | ## Enable API 17 | 18 | ``` 19 | docker run -it \ 20 | -p 27015:27015/tcp \ 21 | -p 27015:27015/udp \ 22 | -e "AUTHKEY=..." \ 23 | hackebein/garrysmod 24 | ``` 25 | Get your [AUTHKEY](http://steamcommunity.com/dev/apikey) 26 | 27 | ## Public 28 | If you have activated the API, this step happens automatically. 29 | 30 | ``` 31 | docker run -it \ 32 | -p 27015:27015/tcp \ 33 | -p 27015:27015/udp \ 34 | -e "GLST=..." \ 35 | hackebein/garrysmod 36 | ``` 37 | 38 | Get your [GLST](http://steamcommunity.com/dev/managegameservers) (`APPID: 4000`) 39 | 40 | ## Workshop Collection 41 | Workshop access requires the API. 42 | 43 | ``` 44 | docker run -it \ 45 | -p 27015:27015/tcp \ 46 | -p 27015:27015/udp \ 47 | -e "AUTHKEY=..." \ 48 | -e "WORKSHOPCOLLECTIONID=..." \ 49 | hackebein/garrysmod 50 | ``` 51 | 52 | ## Config 53 | 54 | ``` 55 | docker run -it \ 56 | -p 27015:27015/tcp \ 57 | -p 27015:27015/udp \ 58 | -v ./server.cfg:/opt/steam/garrysmod/cfg/server.cfg \ 59 | hackebein/garrysmod 60 | ``` 61 | 62 | ## Example for TTT 63 | ``` 64 | # make sure server.cfg file exists 65 | touch ./server.cfg 66 | # start container 67 | docker run -it \ 68 | -p 27015:27015/tcp \ 69 | -p 27015:27015/udp \ 70 | -e "AUTHKEY=..." \ 71 | -e "GAMEMODE=terrortown" \ 72 | -e "MAP=ttt_minecraft_b5" \ 73 | -e "WORKSHOP=843519054" \ 74 | -e "WORKSHOPDL=843519054" \ 75 | -v ./server.cfg:/opt/steam/garrysmod/cfg/server.cfg \ 76 | -v ./overlay:/opt/overlay \ 77 | hackebein/garrysmod 78 | ``` 79 | 80 | Checkout [overlay](https://github.com/Hackebein/docker-srcds#overlay-folder) to overwrite files that are provided by Steam. 81 | Go to [Workshopp Collection](https://steamcommunity.com/sharedfiles/filedetails/?id=843519054) 82 | 83 | ## Additional Environment 84 | 85 | TICKRATE: Tickrate of server, **Attention:** Change not recommended 86 | (`Default: 66`) 87 | 88 | GAMEMODE: 89 | (`Default: sandbox`) 90 | 91 | MAP: Map on Server start 92 | (`Default: gm_flatgrass`) 93 | 94 | CONFIG: Server config, **Attention:** Change not recommended 95 | (`Default: server.cfg`) 96 | 97 | MAXPLAYERS: Max players 98 | (`Default: 16`) 99 | 100 | CUSTOMPARAMETERS: additional parameters 101 | (`Default: `) 102 | 103 | WORKSHOP: downloads workshop collection for server 104 | (`Default: `) 105 | 106 | WORKSHOPDL: downloads workshop collection for client before joining 107 | (`Default: `) 108 | 109 | ## More Options 110 | 111 | You can found more configuration options on the parent image page [hackebein/srcds](https://github.com/Hackebein/docker-srcds) 112 | --------------------------------------------------------------------------------