{"id":15888155,"url":"https://github.com/ceifa/garrysmod-docker","last_synced_at":"2025-04-02T16:44:16.614Z","repository":{"id":107010173,"uuid":"226725185","full_name":"ceifa/garrysmod-docker","owner":"ceifa","description":"A docker image to host a garry's mod server","archived":false,"fork":false,"pushed_at":"2022-07-08T23:15:01.000Z","size":40,"stargazers_count":37,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-08T07:25:09.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ceifa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-08T20:12:37.000Z","updated_at":"2024-12-09T10:05:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"764484d8-3c1e-4215-a77d-c2a0be967264","html_url":"https://github.com/ceifa/garrysmod-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceifa%2Fgarrysmod-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceifa%2Fgarrysmod-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceifa%2Fgarrysmod-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ceifa%2Fgarrysmod-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ceifa","download_url":"https://codeload.github.com/ceifa/garrysmod-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246853353,"owners_count":20844566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T06:06:32.890Z","updated_at":"2025-04-02T16:44:16.594Z","avatar_url":"https://github.com/ceifa.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Garry's mod containers](https://i.imgur.com/QEGv6GM.png \"Garry's mod containers\")][docker-hub-repo]\n\n# Garry's Mod server\nRun a Garry's Mod server easily inside a docker container\n\n## Supported tags\n* `latest` - the most recent production-ready image, based on `debian`\n* `debian` - a gmod server based on debian\n* `debian-x64` - (NOT STABLE YET) a gmod server based on debian but running on beta version of srcds for x64 bit CPUs\n* `debian-root` - same as `debian` but executed as root user\n* `debian-x64-root` - same as `debian-x64` but executed as root user\n* `debian-post` - same as `debian` but the server is installed with the container starting\n* `ubuntu` - a gmod server based on ubuntu\n\n## Features\n\n* Run a server under a linux non-root user\n* Run a server under an anonymous steam user\n* Run server commands normally\n* Installed CSS content\n* Check and update server automatically\n* Production and development build\n\n## Documentation\n\n### Ports\nThe container uses the following ports:\n* `:27015 TCP/UDP` as the game transmission, pings and RCON port\n* `:27005 UDP` as the client port\n\nYou can read more about these ports on the [official srcds documentation][srcds-connectivity].\n\n### Environment variables\n\n**`PRODUCTION`**\n\nSet if the server should be opened in production mode. This will make hot reload modifications to lua files not working. Possible values are `0`(default) or `1`.\n\n**`HOSTNAME`**\n\nSet the server name on startup.\n\n**`MAXPLAYERS`**\n\nSet the maximum players allowed to join the server. Default is `16`.\n\n**`GAMEMODE`**\n\nSet the server gamemode on startup. Default is `sandbox`.\n\n**`MAP`**\n\nSet the map gamemode on startup. Default is `gm_construct`.\n\n**`PORT`**\n\nSet the server port on container. Default is `27015`.\n\n**`GSLT`**\n\nSet the server GSLT credential to be used.\n\n**`ARGS`**\n\nSet any other custom args you want to pass to srcds runner.\n\n### Directory structure\nIt's not the full directory tree, I just put the ones I thought most important\n\n```cs\n📦 /home/gmod // The server root\n|__📁steamcmd // Steam cmd, used to update the server when needed\n|__📁mounts // All third party games should be installed here\n|  |  |__📁cstrike // Counter strike: Source comes installed as default\n|__📁server\n|  |__📁garrysmod\n|  |  |__📁addons // Put your addons here\n|  |  |__📁gamemodes // Put your gamemodes here\n|  |  |__📁data\n|  |  |__📁cfg\n|  |  |  |__⚙️server.cfg\n|  |  |__📁lua\n|  |  |__📁cfg\n|  |  |__💾sv.db\n|  |__📃srcds_run\n|__📃start.sh // Script to start the server\n|__📃update.txt // Steam cmd script to run before start the server\n```\n\n## Examples\n\nThis will start a simple server in a container named `gmod-server`:\n```sh\ndocker run \\\n    -p 27015:27015/udp \\\n    -p 27015:27015 \\\n    -p 27005:27005/udp \\\n    --name gmod-server \\\n    -it \\\n    ceifa/gmod-server\n```\n\nThis will start a server with host workshop collection pointing to [382793424][workshop-example] named `gmod-server`:\n```sh\ndocker run \\\n    -p 27015:27015/udp \\\n    -p 27015:27015 \\\n    -p 27005:27005/udp \\\n    -e ARGS=\"+host_workshop_collection 382793424\" \\\n    -it \\\n    ceifa/gmod-server\n```\n\nThis will start a server named `my server` in production mode pointing to a local addons with a custom gamemode:\n```sh\ndocker run \\\n    -p 27015:27015/udp \\\n    -p 27015:27015 \\\n    -p 27005:27005/udp \\\n    -v $PWD/addons:/home/gmod/server/garrysmod/addons \\\n    -v $PWD/gamemodes:/home/gmod/server/garrysmod/gamemodes \\\n    -e HOSTNAME=\"my server\" \\\n    -e PRODUCTION=1 \\\n    -e GAMEMODE=darkrp \\\n    -it \\\n    ceifa/gmod-server\n```\n\nYou can create a new docker image using this image as base too:\n\n```dockerfile\nFROM ceifa/gmod-server:latest\n\nCOPY ./deathrun-addons /home/gmod/server/garrysmod/addons\n\nENV NAME=\"Lory | Deathrun ~ Have fun!\"\nENV ARGS=\"+host_workshop_collection 382793424\"\nENV MAP=\"deathrun_atomic_warfare\"\nENV GAMEMODE=\"deathrun\"\nENV MAXPLAYERS=\"24\"\n```\n\nMore examples can be found at [my real use case github repository][lory-repo].\n\n## Health Check\n\nThis image contains a health check to continually ensure the server is online. That can be observed from the STATUS column of docker ps\n\n```sh\nCONTAINER ID        IMAGE                    COMMAND                 CREATED             STATUS                    PORTS                                                                                     NAMES\ne9c073a4b262        ceifa/gmod-server        \"/home/gmod/start.sh\"   21 minutes ago      Up 21 minutes (healthy)   0.0.0.0:27005-\u003e27005/tcp, 27005/udp, 0.0.0.0:27015-\u003e27015/tcp, 0.0.0.0:27015-\u003e27015/udp   distracted_cerf\n```\n\nYou can also query the container's health in a script friendly way:\n\n```sh\n\u003e docker container inspect -f \"{{.State.Health.Status}}\" e9c073a4b262\nhealthy\n```\n\n## License\n\nThis image is under the [MIT license](licence).\n\n## TODO:\n\n* Add multi-stages to build\n\n[docker-hub-repo]: https://hub.docker.com/r/ceifa/garrysmod \"Docker hub repository\"\n\n[srcds-connectivity]: https://developer.valvesoftware.com/wiki/Source_Dedicated_Server#Connectivity \"Valve srcds connectivity documentation\"\n\n[workshop-example]: https://steamcommunity.com/sharedfiles/filedetails/?id=382793424 \"Steam workshop collection\"\n\n[lory-repo]: https://github.com/ceifa/lory-gmod-servers \"Lory server repository\"\n\n[licence]: https://github.com/ceifa/garrysmod-docker/blob/master/LICENSE \"Licence of use\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceifa%2Fgarrysmod-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceifa%2Fgarrysmod-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceifa%2Fgarrysmod-docker/lists"}