Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
1733723
Fixed OpenTTD so that it builds
matthewh86 Aug 21, 2018
03b75ad
Functional OpenTTD configuration
matthewh86 Aug 21, 2018
bfd569a
Minor space formatting
matthewh86 Aug 21, 2018
98e257b
Add Left4Dead2 metamod
matthewh86 Aug 22, 2018
179e0be
Add Insurgency
matthewh86 Aug 22, 2018
f8ddd43
Add readme
matthewh86 Aug 22, 2018
b31559f
Add GunGame and Hide+Seek
matthewh86 Aug 23, 2018
8e23c20
Add ABM
matthewh86 Aug 25, 2018
5f37157
Change FULL_ADMINS variable (doesn't seem to work)
matthewh86 Aug 25, 2018
35b69cf
Add L4DToolZ and mission changer plugins
matthewh86 Aug 27, 2018
43aad58
Rename l4d2-abm to l4d2-moreslots
matthewh86 Aug 27, 2018
ce409a0
Removed environment/config variables which did not work
matthewh86 Aug 27, 2018
64a2052
Add TICKRATE and update readme with build notes
matthewh86 Aug 27, 2018
f5d6c67
Standardised the css directory contents
matthewh86 Aug 27, 2018
b8fef32
Renamed start scripts
matthewh86 Aug 27, 2018
cd9be2f
Download Trackmania as part of Docker build
matthewh86 Aug 21, 2018
eab7324
Added extra environment variables for configuration
matthewh86 Aug 27, 2018
4b49366
use /openttd as path and set default passwords
matthewh86 Apr 15, 2019
8e9e7fc
Merge remote-tracking branch 'origin/master' into fix-openttd
matthewh86 Apr 15, 2019
f6a5992
Merge pull request #1 from noxtech/fix-openttd
matthewh86 Apr 15, 2019
d5e0971
Merge remote-tracking branch 'origin/master' into fix-trackmania
matthewh86 Apr 15, 2019
0168f3d
Merge pull request #2 from noxtech/fix-trackmania
matthewh86 Apr 15, 2019
2243e2c
Merge remote-tracking branch 'origin/master' into l4d2-metamod
matthewh86 Apr 15, 2019
5ee7490
Merge pull request #3 from noxtech/l4d2-metamod
matthewh86 Apr 15, 2019
c5cda91
Merge remote-tracking branch 'origin/master' into css-hideandseek-gun…
matthewh86 Apr 15, 2019
b17944e
Merge pull request #4 from noxtech/css-hideandseek-gungame
matthewh86 Apr 15, 2019
c5aad24
Merge remote-tracking branch 'origin/master' into add-insurgency
matthewh86 Apr 15, 2019
8f33a65
Merge pull request #5 from noxtech/add-insurgency
matthewh86 Apr 15, 2019
41fd8d0
Merge remote-tracking branch 'origin/master' into l4d2-moreslots
matthewh86 Apr 15, 2019
fc376d5
Merge pull request #6 from noxtech/l4d2-moreslots
matthewh86 Apr 15, 2019
27634c4
Merge remote-tracking branch 'osl/master'
matthewh86 Apr 15, 2019
03ea8a8
Merge remote-tracking branch 'origin/master' into merge-osl
matthewh86 Apr 15, 2019
857f7b0
Merge pull request #7 from noxtech/merge-osl
matthewh86 Apr 15, 2019
38ba50f
remove utility files from CSGO
matthewh86 Apr 15, 2019
b4206a8
update openttd
matthewh86 Apr 16, 2019
7510983
remove common scripts
matthewh86 Apr 16, 2019
c9ef5fd
remove build scripts
matthewh86 Apr 16, 2019
af0a42c
update source readmes with LAN troubleshooting
matthewh86 Apr 16, 2019
85679a2
update l4d2 and steamcmd
matthewh86 Apr 16, 2019
ed7d166
update csgo
matthewh86 Apr 16, 2019
a775d6c
add SCPSL and new caching build script
matthewh86 Aug 22, 2021
64a405f
Merge remote-tracking branch 'osl/master'
matthewh86 Aug 25, 2021
7d98f4e
update csgo and remove build.sh files
matthewh86 Aug 25, 2021
f803030
SCP Secret Laboratory
matthewh86 Aug 22, 2022
9bc3919
l4d2 multislot
matthewh86 Aug 26, 2022
94a98f9
Update SCP EXILED and plugins
matthewh86 Jul 26, 2024
2f5354f
set noninteractive for base
matthewh86 Aug 5, 2024
5931eaf
fix l4d2 and multislot after mod updates
matthewh86 Aug 5, 2024
94fef7d
conform tf2 to new pattern, add metamod and mvm
matthewh86 Aug 5, 2024
d2016be
update scpsl-exiled plugins
matthewh86 Aug 5, 2024
beee73c
conform insurgency to new pattern
matthewh86 Aug 5, 2024
1acdcd3
conform css to new pattern, metamod and gungame
matthewh86 Aug 5, 2024
082f6ad
add EulaAccepted config file
matthewh86 Aug 8, 2024
34e3049
use DOCKER_BUILDKIT
matthewh86 Aug 8, 2024
79fc6eb
tidy up l4d2 filenames
matthewh86 Aug 8, 2024
2b936b9
base and steamcmd minor refactor
matthewh86 Aug 14, 2024
6c988cb
update l4d2
matthewh86 Aug 14, 2024
6bdaf3e
update css
matthewh86 Aug 14, 2024
dfabfca
add cleanup script
matthewh86 Aug 14, 2024
8df3112
update insurgency
matthewh86 Aug 14, 2024
0f90466
update hl2dm
matthewh86 Aug 14, 2024
962a348
move old build servers into legacy folder
matthewh86 Aug 14, 2024
2fadbb3
add wip to wips
matthewh86 Aug 14, 2024
969d15b
refactor base, steamcmd, and update l4d2
matthewh86 Aug 29, 2024
38de9c6
remove legacy .cache-info remnants
matthewh86 Aug 29, 2024
7113fcd
l4d2 start.sh fix
matthewh86 Aug 30, 2024
d393a10
css updates
matthewh86 Aug 30, 2024
8ca9873
move DOCKER_BUILDKIT from docker build
matthewh86 Aug 30, 2024
dc5c445
use COPY instead of ADD
matthewh86 Aug 30, 2024
04792b3
css and gungame improvements
matthewh86 Aug 30, 2024
7e92a5b
rework css configuration and add deathmatch
matthewh86 Sep 2, 2024
ed7aae8
add blackmesa
matthewh86 Aug 6, 2025
948925b
update docker_build.sh
matthewh86 Aug 6, 2025
283cc83
update scpsl-exiled
matthewh86 Aug 6, 2025
832b78e
update css Dockerfile
matthewh86 Aug 6, 2025
ace6f6a
remove gungame files from css-deathmatch
matthewh86 Aug 6, 2025
fac36a3
update l4d2-multislot
matthewh86 Aug 6, 2025
697ef95
update ut2004
matthewh86 Aug 6, 2025
4bc09cb
add cs1_6-wip
matthewh86 Aug 6, 2025
a2e6f58
add CACHE_DATE to tf2-melkort-mvm-wip
matthewh86 Aug 6, 2025
6d58c29
set progress=plain
matthewh86 Aug 7, 2025
6bced09
update ut2004
matthewh86 Aug 7, 2025
4a3a4ad
update openttd
matthewh86 Aug 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ gamedata/
/data
wads/
RemoteControlExamples/


.cache/
tmp/
server_files/
.cache
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# gameservers-docker

Putting game servers in Docker containers. Because it makes life easier.

Expand All @@ -8,25 +9,29 @@ or sourcemod for srcds), making it almost one command to install a server.
No binaries are stored in this repo, so make sure you have internet to
download them with.

Includes a utility script `start_server.sh` which mounts save data to an
external volume and sorts out networking for you.
Includes utility scripts:

- `start_server.sh` - mounts save data to an external volume and sorts out networking for you
- `docker_build.sh` - builds the specified list of containers. e.g. `docker_build.sh css,css-metamod,tf2`

## Quick start

Assuming you are on a blank server with Git and docker installed:

```
git clone https://github.com/OpenSourceLAN/gameservers-docker.git .
./build.sh factorio
```
Check the game directory for existing templates and make your configurations before building.
```
./docker_build.sh factorio

./start_server.sh factorio
# Or
docker run -it --net=host -e "SERVER_NAME=Some really cool server"\
-v `pwd`/save:`cat factorio/mounts` --name factorio factorio

```

Most servers have environment variables that can be used to configure them.
Most servers have environment variables that can be used to configure them after building them.
Read the README.md file in each directory to see what is available.

## Tutorial
Expand Down Expand Up @@ -146,6 +151,13 @@ Make an easy way to import config files in to the servers (eg mounting cfg direc

Add more games

### Useful scripts

- Remove container data
```
sudo rm -fr /var/lib/docker/containers && sudo mkdir containers && sudo chmod 700 containers
```

### LICENSE

This project is licensed under GPL 3.0. See LICENSE for more information.
33 changes: 25 additions & 8 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
FROM ubuntu:16.04
ARG DISTRO="20.04"

FROM ubuntu:${DISTRO}

ARG TZ="Etc/UTC"
RUN sed -i 's/archive.ubuntu.com/au.archive.ubuntu.com/' /etc/apt/sources.list
RUN apt-get update && apt-get dist-upgrade -y &&\
apt-get install -y unzip p7zip-full curl wget lib32gcc1 iproute2 vim-tiny bzip2 jq software-properties-common apt-transport-https lib32stdc++6 && \
apt-get clean
RUN echo "$TZ" > /etc/timezone
RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y \
git \
unzip \
p7zip-full\
curl\
wget\
lib32gcc1\
lib32stdc++6\
iproute2\
vim-tiny\
bzip2\
jq\
software-properties-common\
apt-transport-https\
rsync \
&& apt-get clean

# add to base install:
RUN echo "$TZ" > /etc/timezone \
&& ln -fs /usr/share/zoneinfo/$TZ /etc/localtime
5 changes: 0 additions & 5 deletions base/build.sh

This file was deleted.

8 changes: 8 additions & 0 deletions blackmesa/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/config-templates
Dockerfile
README.md
.cache-info
.dockerignore
.env
.gitignore
.git
1 change: 1 addition & 0 deletions blackmesa/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
server.cfg
27 changes: 27 additions & 0 deletions blackmesa/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM steamcmd

ENV GAME=mesa
ENV APP_ID=346680

WORKDIR /steam/${GAME}/

USER root

RUN chown -R steam /steam/${GAME}/
USER steam

RUN /steam/steamcmd_linux/steamcmd.sh +login anonymous +force_install_dir /steam/${GAME} +app_update ${APP_ID} +quit
ARG CACHE_DATE
RUN /steam/steamcmd_linux/steamcmd.sh +login anonymous +force_install_dir /steam/${GAME} +app_update ${APP_ID} +quit

RUN mkdir -p /home/steam/.steam \
&& mkdir -p /home/steam/.steam/sdk32 \
&& ln -s /steam/steamcmd_linux/linux32/steamclient.so /home/steam/.steam/sdk32/steamclient.so

COPY --chown=steam download.sh .
RUN ./download.sh

COPY --chown=steam start.sh .
COPY --chown=steam server.cfg /steam/mesa/bms/cfg/server.cfg

ENTRYPOINT ["./start.sh"]
12 changes: 12 additions & 0 deletions blackmesa/config-templates/server.template.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Black Mesa server.cfg file
hostname "Black Mesa: LAN"
mp_timelimit 3600
mp_fraglimit 30
mp_teamplay 1
mp_forcerespawn 1
//sv_password pass123
//sv_always_run 1
sv_cheats 1
sourcecoop_difficulty_auto -1
sourcecoop_difficulty 3
sourcecoop_ft KEEP_EQUIPMENT 1
9 changes: 9 additions & 0 deletions blackmesa/download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://www.sourcemm.net/
wget https://mms.alliedmods.net/mmsdrop/1.12/mmsource-1.12.0-git1219-linux.tar.gz
tar -xvzf mmsource-1.12.0-git1219-linux.tar.gz -C /steam/mesa/bms
rm -f mmsource-1.12.0-git1219-linux.tar.gz

# https://www.sourcemod.net/
wget https://sm.alliedmods.net/smdrop/1.12/sourcemod-1.12.0-git7210-linux.tar.gz
tar -xvzf sourcemod-1.12.0-git7210-linux.tar.gz -C /steam/mesa/bms
rm -f sourcemod-1.12.0-git7210-linux.tar.gz
8 changes: 8 additions & 0 deletions blackmesa/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# local vars
[[ $LAN -ge 1 ]] && LAN="1" || LAN="0"
[[ -z "$MAP" ]] && MAP="bm_c0a0a"
[[ -z $MAXPLAYERS ]] && MAXPLAYERS="24"

exec ./srcds_run -game bms +exec server.cfg +sv_lan $LAN +ip 0.0.0.0 +map $MAP -usercon -port 27015 -maxplayers $MAXPLAYERS -secure $OTHER_ARGS $@
7 changes: 0 additions & 7 deletions build.sh

This file was deleted.

37 changes: 0 additions & 37 deletions common.sh

This file was deleted.

7 changes: 7 additions & 0 deletions cs1_6-wip/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/config-templates
Dockerfile
README.md
.dockerignore
.env
.gitignore
.git
33 changes: 33 additions & 0 deletions cs1_6-wip/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM steamcmd

ENV GAME=hlds

WORKDIR /steam/${GAME}/

USER root
RUN chown -R steam /steam/${GAME}/
USER steam

RUN mkdir /steam/${GAME}/steamapps/
WORKDIR /steam/${GAME}/steamapps/
RUN for i in 10 70 90; do wget -q https://raw.githubusercontent.com/dgibbs64/HLDS-appmanifest/main/CounterStrike/appmanifest_$i.acf -O appmanifest_$i.acf; done
WORKDIR /steam/${GAME}/

RUN for i in 10 70 90; do /steam/steamcmd_linux/steamcmd.sh +login anonymous +force_install_dir /steam/${i} +app_update ${i} +quit
ARG CACHE_DATE
RUN for i in 10 70 90; do /steam/steamcmd_linux/steamcmd.sh +login anonymous +force_install_dir /steam/${i} +app_update ${i} +quit

# figure out what this is doing
# https://github.com/MartinHajducik/cs16ds/blob/main/Dockerfile

COPY --chown=steam \
config/ \
configure.sh \
configure-base.sh \
generate-mapcycle.sh \
start.sh \
./

ENV SV_HOSTNAME="Counterstrike 1.6 (Base)"

ENTRYPOINT ["./start.sh"]
47 changes: 47 additions & 0 deletions cs1_6-wip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Counterstrike Source

Counterstrike Source server without plugins.

## Build notes
To catch updates since the original image was built, run:

```
docker build --build-arg CACHE_DATE="$(date)"
```

This will re-use the previously built image as a base instead of re-downloading everything again.

## Environment variables

The following configuration is available via setting environment variables:

```
hostname $SV_HOSTNAME
rcon_password $RCON_PASSWORD
sv_password $SV_PASSWORD
mp_friendlyfire $MP_FRIENDLYFIRE
mp_timelimit $MP_TIMELIMIT
mp_maxrounds $MP_MAXROUNDS
mp_roundtime $MP_ROUNDTIME
mp_autoteambalance $MP_AUTOTEAMBALANCE
bot_quota $BOT_QUOTA
bot_quota_mode $BOT_QUOTA_MODE
bot_join_after_player $BOT_JOIN_AFTER_PLAYER
bot_difficulty $BOT_DIFFICULTY
bot_prefix $BOT_PREFIX
bot_defer_to_human $BOT_DEFER_TO_HUMAN
bot_auto_vacate $BOT_AUTO_VACATE
bot_chatter $BOT_CHATTER
bot_allow_grenades $BOT_ALLOW_GRENADES
bot_allow_pistols $BOT_ALLOW_PISTOLS
bot_allow_rifles $BOT_ALLOW_RIFLES
bot_allow_rogues $BOT_ALLOW_ROGUES
bot_allow_shotguns $BOT_ALLOW_SHOTGUNS
bot_allow_snipers $BOT_ALLOW_SNIPERS
bot_allow_machine_guns $BOT_ALLOW_MACHINE_GUNS
bot_allow_sub_machine_guns $BOT_ALLOW_SUB_MACHINE_GUNS
```
## Troubleshooting

### I can't see the LAN Server!
* Try disabling `Automatic Metric` and entering `1` for your LAN/WiFi adapter
40 changes: 40 additions & 0 deletions cs1_6-wip/config/cstrike/cfg/motd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title>Cstrike MOTD</title>
<style type="text/css">
pre {
font-family:Verdana,Tahoma;
color:#FFB000;
}
body {
background:#000000;
margin-left:8px;
margin-top:0px;
}
a {
text-decoration: underline;
}
a:link {
color: #FFFFFF;
}
a:visited {
color: #FFFFFF;
}
a:active {
color: #FFFFFF;
}
a:hover {
color: #FFFFFF;
text-decoration: underline;
}
</style>
</head>
<body scroll="no">
<pre>
You are playing Counter-Strike: Source
Visit the official CS web site @
www.counter-strike.net
<a href="http://www.counter-strike.net">Visit Counter-Strike.net</a>
</pre>
</body>
3 changes: 3 additions & 0 deletions cs1_6-wip/config/cstrike/cfg/motd_text.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
You are playing Counter-Strike: Source
Visit the official CS web site @
www.counter-strike.net
File renamed without changes.
Loading