Giter Site home page Giter Site logo

docker-garrysmod-server's Introduction

Dockerized Garry's Mod server

Runs your Garry's Mod server inside Docker container as an executable

Features

  • Gmod running under non-root user (steam)
  • Working luarefresh. You can update your scripts and changes will apply instantly
  • Installed CSS content
  • You can run commands in your container like it's not containered server
  • Correct GetConVarString("hostip") if run with docker-compose (just edit ip inside .env)
  • tmysql4, luasocket and some .dll modules works fine

Example

For detailed info look inside start.sh and docker-compose.yml

Also you can run your server with docker run. Simple example:

docker build -t gmod-server . ; docker run --rm -it --name gmod \
    -p 27015:27015/udp \
    -v $PWD/volume/addons:/gmodserv/garrysmod/addons/ \
    gmod-server \
        -port 27015 \
        -tickrate 32 \
        -maxplayers 8 \
        +map gm_construct \

Notes

  • This image requires ~10GB of free space
  • All you need (addons, data, gamemodes) located in /gmodserv/garrysmod
  • Such modules like gmsv_socket_linux.dll requires additional port forwarding rules. Example. If you plan to use 27030/tcp then you need to add following option to docker run command: -p 27030:27030/tcp
  • The next useful thing it's --rm option. If you use it the container will automatically removed after srcds process being killed. You should not remove trash containers by hands with this param
  • --name anyname assign pretty name to your container
  • -d option runs container in background. You can attach them with docker attach container_name (don't use with --rm).
  • -it there is 2 options where -t allocate a pseudo-TTY (required) and -i which allow you to interact with gmod console (run commands etc)
  • docker logs -f container_name let's receive logs from server!
  • docker exec -it container_name bash connect to container shell

Todo

  • Make srcds inside container able to do restarts (keep no restart and add a watchdog script) to restart it, will have to tinker with container
  • Update readme with permission instructions for mounting volume
  • Add autoreconnect and other gamemodes

docker-garrysmod-server's People

Contributors

amd-nick avatar rooday avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.