truncate history

This commit is contained in:
paul 2017-04-13 10:57:41 +02:00
commit 6e09887eac
4 changed files with 151 additions and 0 deletions

10
Dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM zombi/steam-base
MAINTAINER MadMaurice <madmaurice@zom.bi>, Paul <paul@zom.bi>
EXPOSE 27015/udp
ADD bin/entrypoint.sh /entrypoint.sh
RUN chmod +xr /entrypoint.sh
USER steam
ENTRYPOINT ["./entrypoint.sh"]
CMD ["+maxplayers", "16", "+hostname", "Zom.bi TTT", "+gamemode", "terrortown", "+map", "gm_construct"]

81
README.md Normal file
View file

@ -0,0 +1,81 @@
## steam-gmod
steam-gmod is the base image for an "Gary's Mod" server, combined with a CounterStrike:Source server for assets.
### Data locations
* maps in /home/steam/gmod/garrysmod/maps
* server configuration in /home/steam/gmod/garrysmod/cfg/server.cfg
* bans in /home/steam/gmod/garrysmod/cfg/banned_user.cfg
* motd in /home/steam/gmod/garrysmod/addons/ulx/ulx_motd.txt
* addon data in /home/steam/gmod/garrysmod/data/
Data for optional mods
* ttt_damagelogs data in /home/steam/gmod/garrysmod/addons/ttt_damagelogs
* damage logs database in /home/steam/gmod/garrysmod/sv.db
### Building steam-gmod
first build the `steam-base` image.
```
docker build -t zombi/steam-gmod .
```
### Running steam-gmod
Please note that you probably want to add a workshop collection, which
can be generated in steam. It is a good idea to put mods like Wiremod,
Ulib, ULX etc. there, and extend with some maps and custom props.
```
docker run -d \
--name gmod-1 \
-p 27015:27015/udp \
-p 27015:27015 \
-v /data/steam-games/:/home/steam/games/ \
-v /data/gmod/maps/:/home/steam/games/garrysmod/garrysmod/maps/ \
-v /data/gmod/server.cfg:/home/steam/games/garrysmod/garrysmod/cfg/server.cfg \
-v /data/gmod/motd.txt:/home/steam/games/garrysmod/garrysmod/addons/ulx/ulx_motd.txt \
-v /data/gmod/bans.cfg:/home/steam/games/garrysmod/garrysmod/cfg/banned_user.cfg \
-v /data/gmod/addons/tttdamagelogs:/home/steam/games/garrysmod/garrysmod/addons/tttdamagelogs/ \
-v /data/gmod/data/:/home/steam/gmod/garrysmod/data/ \
zombi/steam-gmod +hostname "Zom.bi TTT" \
-authkey SUPERLONGAUTHKEYAAAAAAAAA23880ED \
+host_workshop_collection 337948370 \
+gamemode terrortown \
+maxplayers 16 \
+map ttt_dolls
```
to start up a simple server to terrorize some terrorists.
If you want to start up a Sandbox, you can do that too:
```
docker run -d \
--name gmod-1 \
-p 27015:27015/udp \
-p 27015:27015 \
-v /data/steam-games/:/home/steam/games/ \
-v /data/gmod/server.cfg:/home/steam/games/garrysmod/garrysmod/cfg/server.cfg \
-v /data/gmod/motd.txt:/home/steam/games/garrysmod/garrysmod/addons/ulx/ulx_motd.txt \
-v /data/gmod/bans.cfg:/home/steam/games/garrysmod/garrysmod/cfg/banned_user.cfg \
-v /data/gmod/data/:/home/steam/games/garrysmod/garrysmod/data/ \
zombi/steam-gmod +hostname "Zom.bi Sandbox" \
+host_workshop_collection 337948370 \
+gamemode sandbox \
+maxplayers 16 \
+map gm_construct
```
### Data locations
* game data in /home/steam/games
* maps in /home/steam/games/garrysmod/garrysmod/maps
* server configuration in /home/steam/games/garrysmod/garrysmod/cfg/server.cfg
* bans in /home/steam/games/garrysmod/garrysmod/cfg/banned_user.cfg
* motd in /home/steam/games/garrysmod/garrysmod/addons/ulx/ulx_motd.txt
* addon data in /home/steam/games/garrysmod/garrysmod/data/
Data for optional mods
* ttt_damagelogs data in /home/steam/gmod/garrysmod/addons/ttt_damagelogs
protip: you can simplify deployment by using named volumes.

47
bin/entrypoint.sh Normal file
View file

@ -0,0 +1,47 @@
#!/bin/bash
# what are we trying to install?
game_nm=garrysmod
game_id=4020
# install game to this directory
installdir=/home/steam/games/$game_nm
# if path does not exist, create it
mkdir -p $installdir
if [ -w $installdir ] # can we write into the directory?
then
# Install or update the game in /home/steam/games/[game name]
/opt/steamcmd/steamcmd.sh \
+login anonymous \
+force_install_dir $installdir \
+app_update $game_id validate \
+quit
# ----------------------------------------------------------
# GMOD SPECIFIC INSTALLATIONS
# TODO: add mount cfg maybe?
else
# install dir maybe mounted read-only, simply
# skip installing/updating and inform the user.
echo "Skipped game installation."
fi
# run the next commands from the installdir
cd $installdir
# is the game launcher not executable?
if [ ! -x ./srcds_run ]
then
# we cant run the game then.
echo "game launcher not found, installed incorrectly?"
exit 1
fi
# launch the game!
exec ./srcds_run \
-game $game_nm \
-console \
$@ # append all remaining parameters

13
mount.cfg Executable file
View file

@ -0,0 +1,13 @@
//
// Use this file to mount additional paths to the filesystem
// DO NOT add a slash to the end of the filename
//
"mountcfg"
{
"cstrike" "/home/steam/css/cstrike"
// "tf" "C:\mytf2server\tf"
}