{"id":13696311,"url":"https://github.com/OpenSourceLAN/gameservers-docker","last_synced_at":"2025-05-03T17:30:52.715Z","repository":{"id":40336441,"uuid":"48305766","full_name":"OpenSourceLAN/gameservers-docker","owner":"OpenSourceLAN","description":"A bunch of game servers I use, dockerised","archived":false,"fork":false,"pushed_at":"2024-07-26T10:47:30.000Z","size":1479,"stargazers_count":509,"open_issues_count":9,"forks_count":68,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-08-03T18:20:51.074Z","etag":null,"topics":["csgo","docker","game","game-server","lan","minecraft","mumble","quake3","server","tf2","unreal"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenSourceLAN.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}},"created_at":"2015-12-20T03:23:06.000Z","updated_at":"2024-08-01T11:11:28.000Z","dependencies_parsed_at":"2024-01-06T11:52:08.392Z","dependency_job_id":"53e50bce-f2bf-4360-9e25-f101605ec809","html_url":"https://github.com/OpenSourceLAN/gameservers-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/OpenSourceLAN%2Fgameservers-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSourceLAN%2Fgameservers-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSourceLAN%2Fgameservers-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSourceLAN%2Fgameservers-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenSourceLAN","download_url":"https://codeload.github.com/OpenSourceLAN/gameservers-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224369480,"owners_count":17299901,"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":["csgo","docker","game","game-server","lan","minecraft","mumble","quake3","server","tf2","unreal"],"created_at":"2024-08-02T18:00:38.343Z","updated_at":"2024-11-13T00:30:21.607Z","avatar_url":"https://github.com/OpenSourceLAN.png","language":"Shell","funding_links":[],"categories":["Software","Gaming","Shell"],"sub_categories":["Gameserver Configs","Game Servers - Docker"],"readme":"\nPutting game servers in Docker containers. Because it makes life easier.\n\nA set of game servers that have been wrapped with Docker. All images are\ncomposed of other images in this repository, except for base. Most images\nwill auto-download any dependencies they have (eg, factorio server files\nor sourcemod for srcds), making it almost one command to install a server.\nNo binaries are stored in this repo, so make sure you have internet to\ndownload them with.\n\nIncludes a utility script `start_server.sh` which mounts save data to an\nexternal volume and sorts out networking for you.\n\n## Quick start\n\nAssuming you are on a blank server with Git and docker installed:\n\n```\ngit clone https://github.com/OpenSourceLAN/gameservers-docker.git .\n./build.sh factorio\n\n./start_server.sh factorio\n# Or\ndocker run -it --net=host -e \"SERVER_NAME=Some really cool server\"\\\n-v `pwd`/save:`cat factorio/mounts` --name factorio factorio\n\n```\n\nMost servers have environment variables that can be used to configure them.\nRead the README.md file in each directory to see what is available.\n\n## Tutorial\n\nThere is a [tutorial on the Open Source LAN website](http://opensourcelan.com/blog/2017/01/28/containing-your-game-servers/)\nwhich will step you through building and using the images.\n\n## Contributions \nContributions are welcome. Submit a pull request or open an issue. \n\nAll additions should follow these suggestions:\n* Set up for LAN by default - eg, call +sv_lan 1 in srcds games, but optionally disabling that by runtime var is fine\n* Include a start script that is added to the container, so anyone using the Dockerfile can easily customise their server\n\n\n## Advanced networking stuff\n\nWe want to expose all game servers directly to our LAN, and the `--host` option\nmeans we will get port conflicts. There is an alternative approach which uses\nthe ipvlan or macvlan docker network driver.\n\n```\n# Creates a docker network that's bridge with your layer 2 network\n# Subnet should match the IP range and subnet of your network.\n# ip-range is the CIDR block of IP addresses to assign to containers\n# parent is the name of the interface you'd like to bridge containers to\n\ndocker network create --driver ipvlan --subnet=10.0.0.0/24 -o parent=eth0 --ip-range 10.0.0.16/28 --gateway 10.0.0.1  gameservers\n\n# If the above command doesn't work, try using macvlan instead of ipvlan\n\n# Starts your game server inside the layer 2 network\ndocker run -it --rm --net=gameservers csgo /steam/csgo/srcds_run -game csgo +sv_lan 1 +map cs_office\n```\n\nYou can now see the CSGO server from another server on your network.\n\n\n## Running game servers on Docker Swarm\n\n[These are the instructions for building a swarm](https://docs.docker.com/swarm/install-manual/).\n\nIn addition to the swarm, one also needs a docker registry (I think). \n\nThese are the following gotchas that you need to be aware of:\n\n* If using ipvlan, you need _experimental_, not main release docker (as at version 1.12)\n* The ipvlan network is local scoped. This means you need to create the network on every\nhost individually. You should ensure the assigned IP ranges for each host do not overlap,\nas there does not appear to be any shared state about IP addresses assigned. The name of\nthe networks should be identical on every host.\n* The tutorial only has you set up a single consul instance. It will change IP addresses\nevery time the container restarts, and this will cause consul to fail because it cannot\nelect itself leader, since it thinks another instance exists at a different IP address.\nMake sure to hard code an IP for it.\n* Using ubuntu 14.04, you'll need to update `/etc/defaults/docker` to contain: `DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"`\n* If not using a secured docker registry, also add to the `DOCKER_OPTS` value: `--insecure-registry=registry-hostname:5000`\n* Consul, docker node and docker masters can all be on the same host (I think - it works for me at least)\n* To get a container to failover between hosts in the case of an outage, you need to run the container with these args: ` -e reschedule:on-node-failure`\n(todo: figure out why the container doesn't get auto-started on the new host).\nAlso note that a race condition exists - when the host comes back up, it will start the old container, and when \nthe docker swarm manager container starts, it will detect the container was moved and kill it.\n\n### Setting up multiple consul hosts\n\nRun the master like this:\n\n```\ndocker run -d  -v /mnt:/data --name consul \\\n    -p 8300:8300 \\\n    -p 8301:8301 \\\n    -p 8301:8301/udp \\\n    -p 8302:8302 \\\n    -p 8302:8302/udp \\\n    -p 8400:8400 \\\n    -p 8500:8500 \\\n    -p 53:53/udp \\\n    progrium/consul -server -advertise 10.0.0.167 -bootstrap-expect 3\n```\n\nand the other two like this:\n```\n    docker run -d -v /mnt:/data --name consul \\\n    -p 8300:8300 \\\n    -p 8301:8301 \\\n    -p 8301:8301/udp \\\n    -p 8302:8302 \\\n    -p 8302:8302/udp \\\n    -p 8400:8400 \\\n    -p 8500:8500 \\\n    -p 53:53/udp \\\n    progrium/consul -server -advertise 10.0.0.197 -join 10.0.0.167\n```\n\nDouble check all 3 are present in cluster by doing `curl http://localhost:8500/v1/status/peers`.\n\n\n### TODO\n\nEnsure every instance has:\n\n* A README covering available options, startup scripts, etc\n* Auto-mount point support where appropriate (eg, for saves, demos)\n* Config options for at least:\n  * The name of the server (what it shows as in server browsers)\n  * Server password\n  * RCON password (where RCON exists)\n  * LAN or internet\n* Has dockerfile configured with default ports it exposes (not that the suggested configuration uses these)\n* Has a way to easily RCON or remote control\n* Does not require user to manually download everything (with exceptions for some large and customisable downloads)\n* Fix the thing where the auto mounts always have permission problems because conatiners\n\nMake the easy start script support passing environment variables to the container\n\nMake an easy way to import config files in to the servers (eg mounting cfg directories)\n\nAdd more games\n\n### LICENSE\n\nThis project is licensed under GPL 3.0. See LICENSE for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenSourceLAN%2Fgameservers-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenSourceLAN%2Fgameservers-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenSourceLAN%2Fgameservers-docker/lists"}