This commit is contained in:
Max Gonzih 2013-11-03 14:43:58 +03:00
commit 1a75524b07
5 changed files with 48 additions and 0 deletions

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM ubuntu
MAINTAINER Max Gonzih <gonzih at gmail dot com>
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install lib32gcc1 lib32z1 lib32ncurses5 lib32bz2-1.0 lib32asound2 wget
RUN adduser --gecos "" tf2
USER tf2
ENV HOME /home/tf2
ENV SERVER $HOME/hlserver
RUN mkdir $SERVER
RUN wget -O - http://media.steampowered.com/client/steamcmd_linux.tar.gz | tar -C $SERVER -xvz
ADD ./tf2_ds.txt $SERVER/tf2_ds.txt
ADD ./update.sh $SERVER/update.sh
ADD ./tf.sh $SERVER/tf.sh
RUN $SERVER/update.sh
EXPOSE 27015/udp
ENTRYPOINT ["/home/tf2/hlserver/tf.sh"]
CMD ["+sv_pure", "1", "+map", "pl_badwater.bsp", "+maxplayers", "24"]

16
README.md Normal file
View file

@ -0,0 +1,16 @@
## Team Fortress 2 + Docker
### Details:
By default image is build with enabled autoupdate feature (take a look at tf.sh file).
You can create new Dockerfile based on that image and customize it with plugins, configs, CMD and ENTRYPOINT instructions.
```shell
# Build image and tag it as tf2
docker build github.com/Gonzih/docker-tf2-server -t tf2
# Run image with default options (CMD in Dockerfile)
docker run -d -p 27015:27015/udp tf2
# Run image with custom options
docker run -d -p 27015:27015/udp tf2 +sv_pure 2 +map ctf_2fort.bsp +maxplayers 32
```

3
tf.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cd $HOME/hlserver
tf2/srcds_run -game tf -autoupdate -steam_dir ~/hlserver -steamcmd_script ~/hlserver/tf2_ds.txt $@

4
tf2_ds.txt Normal file
View file

@ -0,0 +1,4 @@
login anonymous
force_install_dir ./tf2
app_update 232250
quit

3
update.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
cd $HOME/hlserver
./steamcmd.sh +runscript tf2_ds.txt