Updates [skip-ci]
Build / latest (push) Successful in 20s

This commit is contained in:
2026-06-14 10:37:25 +02:00
parent fefb6fa7fe
commit 7f5e59925a
2 changed files with 82 additions and 52 deletions
-2
View File
@@ -1,2 +0,0 @@
github: hackebein
custom: paypal.me/hackebein
+82 -50
View File
@@ -1,69 +1,100 @@
# What is Garry's Mod? # docker-garrysmod
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. A Docker image for running a [Garry's Mod](https://gmod.facepunch.com/) dedicated server, based on [hackebein/docker-srcds](https://github.com/Hackebein/docker-srcds).
# Quick Start This repository is a fork of [Hackebein/docker-garrysmod](https://github.com/Hackebein/docker-garrysmod).
## Basic Garry's Mod is a physics sandbox. There aren't any predefined aims or goals. The game gives you the tools and leaves you to play.
The image is automatically built and pushed to:
```text
git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
## Table of Contents
- [Quick Start](#quick-start)
- [Enabling the Steam API](#enabling-the-steam-api)
- [Public Listing](#public-listing)
- [Workshop Collections](#workshop-collections)
- [Custom Server Configuration](#custom-server-configuration)
- [Example: Trouble in Terrorist Town (TTT)](#example-trouble-in-terrorist-town-ttt)
- [Environment Variables](#environment-variables)
- [Overlay Folder](#overlay-folder)
- [Further Configuration](#further-configuration)
## Quick Start
Start a basic sandbox server on the default port (`27015`):
```bash
docker run -it \ docker run -it \
-p 27015:27015/tcp \ -p 27015:27015/tcp \
-p 27015:27015/udp \ -p 27015:27015/udp \
hackebein/garrysmod git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
## Enable API ## Enabling the Steam API
``` Some features (public server listing, Workshop downloads) require a Steam Web API key.
```bash
docker run -it \ docker run -it \
-p 27015:27015/tcp \ -p 27015:27015/tcp \
-p 27015:27015/udp \ -p 27015:27015/udp \
-e "AUTHKEY=..." \ -e "AUTHKEY=..." \
hackebein/garrysmod git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
Get your [AUTHKEY](http://steamcommunity.com/dev/apikey)
## Public Get your `AUTHKEY` from <http://steamcommunity.com/dev/apikey>.
If you have activated the API, this step happens automatically.
``` ## Public Listing
If you've set `AUTHKEY`, your server is automatically listed publicly. Alternatively, you can register a Game Server Login Token (GLST) manually:
```bash
docker run -it \ docker run -it \
-p 27015:27015/tcp \ -p 27015:27015/tcp \
-p 27015:27015/udp \ -p 27015:27015/udp \
-e "GLST=..." \ -e "GLST=..." \
hackebein/garrysmod git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
Get your [GLST](http://steamcommunity.com/dev/managegameservers) (`APPID: 4000`) Get your `GLST` from <http://steamcommunity.com/dev/managegameservers> (App ID: `4000`).
## Workshop Collection ## Workshop Collections
Workshop access requires the API.
``` Downloading Workshop content requires `AUTHKEY` to be set.
```bash
docker run -it \ docker run -it \
-p 27015:27015/tcp \ -p 27015:27015/tcp \
-p 27015:27015/udp \ -p 27015:27015/udp \
-e "AUTHKEY=..." \ -e "AUTHKEY=..." \
-e "WORKSHOPCOLLECTIONID=..." \ -e "WORKSHOPCOLLECTIONID=..." \
hackebein/garrysmod git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
## Config ## Custom Server Configuration
``` Mount your own `server.cfg` into the container:
```bash
docker run -it \ docker run -it \
-p 27015:27015/tcp \ -p 27015:27015/tcp \
-p 27015:27015/udp \ -p 27015:27015/udp \
-v ./server.cfg:/opt/steam/garrysmod/cfg/server.cfg \ -v ./server.cfg:/opt/steam/garrysmod/cfg/server.cfg \
hackebein/garrysmod git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
## Example for TTT ## Example: Trouble in Terrorist Town (TTT)
```
# make sure server.cfg file exists ```bash
# make sure the server.cfg file exists
touch ./server.cfg touch ./server.cfg
# start container
# start the container
docker run -it \ docker run -it \
-p 27015:27015/tcp \ -p 27015:27015/tcp \
-p 27015:27015/udp \ -p 27015:27015/udp \
@@ -74,38 +105,39 @@ docker run -it \
-e "WORKSHOPDL=843519054" \ -e "WORKSHOPDL=843519054" \
-v ./server.cfg:/opt/steam/garrysmod/cfg/server.cfg \ -v ./server.cfg:/opt/steam/garrysmod/cfg/server.cfg \
-v ./overlay:/opt/overlay \ -v ./overlay:/opt/overlay \
hackebein/garrysmod git.sh-edraft.de/sh-edraft.de/garrysmod
``` ```
Checkout [overlay](https://github.com/Hackebein/docker-srcds#overlay-folder) to overwrite files that are provided by Steam. This uses the [TTT Workshop Collection](https://steamcommunity.com/sharedfiles/filedetails/?id=843519054), downloaded both server-side (`WORKSHOP`) and client-side (`WORKSHOPDL`).
Go to [Workshopp Collection](https://steamcommunity.com/sharedfiles/filedetails/?id=843519054)
## Additional Environment ## Environment Variables
TICKRATE: Tickrate of server, **Attention:** Change not recommended | Variable | Description | Default |
(`Default: 66`) | --- | --- | --- |
| `AUTHKEY` | Steam Web API key. Required for the public server list and Workshop downloads. Get one at <http://steamcommunity.com/dev/apikey> | _(empty)_ |
| `GLST` | Game Server Login Token for public listing. Get one at <http://steamcommunity.com/dev/managegameservers> (App ID `4000`). Not needed if `AUTHKEY` is set | _(empty)_ |
| `GAME` | Game mod directory | `garrysmod` |
| `GAMEMODE` | Gamemode to run on server start | `sandbox` |
| `MAP` | Map to load on server start | `gm_flatgrass` |
| `MAPGROUP` | Map group / map cycle group | `mg_active` |
| `GAMETYPE` | Game type passed to the server | `0` |
| `MAXPLAYERS` | Maximum number of players | `16` |
| `TICKRATE` | Server tickrate. **Note:** changing this is not recommended | `66` |
| `CONFIG` | Server config file, relative to `cfg/`. **Note:** changing this is not recommended | `server.cfg` |
| `WORKSHOP` | Workshop collection ID to download for the server | _(empty)_ |
| `WORKSHOPDL` | Workshop collection ID for clients to download before joining | _(empty)_ |
| `CUSTOMPARAMETERS` | Additional raw command-line parameters appended to the server start command | _(empty)_ |
GAMEMODE: ## Overlay Folder
(`Default: sandbox`)
MAP: Map on Server start You can use an overlay folder to add or overwrite files provided by Steam (e.g. addons, configs, maps) without rebuilding the image:
(`Default: gm_flatgrass`)
CONFIG: Server config, **Attention:** Change not recommended ```bash
(`Default: server.cfg`) -v ./overlay:/opt/overlay
```
MAXPLAYERS: Max players See [hackebein/docker-srcds: Overlay folder](https://github.com/Hackebein/docker-srcds#overlay-folder) for details.
(`Default: 16`)
CUSTOMPARAMETERS: additional parameters ## Further Configuration
(`Default: `)
WORKSHOP: downloads workshop collection for server This image inherits all environment variables and options from the parent image. See [hackebein/docker-srcds](https://github.com/Hackebein/docker-srcds) for the full list of available configuration options.
(`Default: `)
WORKSHOPDL: downloads workshop collection for client before joining
(`Default: `)
## More Options
You can found more configuration options on the parent image page [hackebein/srcds](https://github.com/Hackebein/docker-srcds)