Sign inSign up

datmoyan/tf2c

By datmoyan

Updated about 5 years ago

Image
0

284

datmoyan/tf2c repository overview

What is Team Fortress 2 Classic?

A re-imagining of the 2008 era of the original Team Fortress 2, adding in old features that were scrapped and working upon them or adding new content such as weapons and game modes. This Docker image contains the dedicated server of the game.

Team Fortress 2 Classic.png

How to use this image

Hosting a simple game server

Running on the host interface (recommended):

$ docker run -d --net=host --name=tf2-dedicated -e SRCDS_TOKEN={YOURTOKEN} jobggun/tf2c

Running using a bind mount for data persistence on container recreation:

$ mkdir -p $(pwd)/tf2-data
$ chmod 777 $(pwd)/tf2-data # Makes sure the directory is writeable by the unprivileged container user
$ docker run -d --net=host -v $(pwd)/tf2-data:/home/steam/tf-dedicated/ --name=tf2-dedicated -e SRCDS_TOKEN={YOURTOKEN} jobggun/tf2c

Running multiple instances (increment SRCDS_PORT and SRCDS_TV_PORT):

$ docker run -d --net=host --name=tf2-dedicated2 -e SRCDS_PORT=27016 -e SRCDS_TV_PORT=27021 -e SRCDS_TOKEN={YOURTOKEN} jobggun/tf2c

SRCDS_TOKEN is required to be listed & reachable; https://steamcommunity.com/dev/managegameservers

SRCDS_WORKSHOP_AUTHKEY is required to use the workshop; https://steamcommunity.com/dev/apikey

It's also recommended to use "--cpuset-cpus=" to limit the game server to a specific core & thread.
The container will automatically update the game on startup, so if there is a game update just restart the container.

Configuration

Environment Variables

Feel free to overwrite these environment variables, using -e (--env):

SRCDS_TOKEN="changeme" (value is is required to be listed & reachable, retrieve token here: https://steamcommunity.com/dev/managegameservers)
SRCDS_RCONPW="changeme" (value can be overwritten by tf/cfg/server.cfg) 
SRCDS_PW="changeme" (value can be overwritten by tf/cfg/server.cfg) 
SRCDS_PORT=27015
SRCDS_TV_PORT=27020
SRCDS_IP="0" (local ip to bind)
SRCDS_FPSMAX=300
SRCDS_TICKRATE=66
SRCDS_MAXPLAYERS=14
SRCDS_REGION=3
SRCDS_HOSTNAME="New TF Server" (first launch only)
SRCDS_WORKSHOP_AUTHKEY="" (required to load workshop maps)

Config

You can edit the config using this command:

$ docker exec -it tf2-dedicated nano /home/steam/tf-dedicated/tf/cfg/server.cfg

If you want to learn more about configuring a TF2 server check this documentation.

Image Variants:

The tf2c images come in three flavors, each designed for a specific use case.

tf2c:latest

This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is a bare-minimum TF2 dedicated server containing no 3rd party plugins.

Contributors

Contributors Display

Tag summary

Content type

Image

Digest

Size

236.5 MB

Last updated

about 5 years ago

docker pull datmoyan/tf2c