Skip to content

Commit b5d3c56

Browse files
committed
wip
1 parent 80c28d5 commit b5d3c56

File tree

12 files changed

+479
-22
lines changed

12 files changed

+479
-22
lines changed

Justfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@ sourcemod: srcds
1212
csgo-dm: sourcemod
1313
cd csgo/deathmatch && docker build -t {{org}}/csgo-deathmatch .
1414

15-
all: csgo-dm
15+
csgo-kz: sourcemod
16+
cd csgo/kz && docker build -t {{org}}/csgo-kz .
17+
18+
csgo-surf: sourcemod
19+
cd csgo/surf && docker build -t {{org}}/csgo-surf .
20+
21+
all: csgo-dm csgo-kz csgo-surf

README.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,44 @@
1-
### csgo-ds-docker
1+
# csgo-ds-docker
22

3+
## Usage
34

4-
```
5+
### Install CS:GO Dedicated Server
6+
7+
target: /opt/gameservers/csgo-ds
8+
9+
```terminal
510
docker run -it \
611
-e STEAM_USERNAME=$STEAM_USERNAME \
712
-e STEAM_PASSWORD=$STEAM_PASSWORD \
8-
-v /opt/gameservers/csgo-ds:/data \
13+
-v /opt/gameservers/csgo-ds:/csgo-ds \
914
--entrypoint sh \
10-
steamcmd \
11-
-c 'steamcmd +force_install_dir /data +login "$STEAM_USERNAME" "$STEAM_PASSWORD" +app_update 740 +quit'
15+
saiko-tech/steamcmd \
16+
-c 'steamcmd +force_install_dir /csgo-ds +login "$STEAM_USERNAME" "$STEAM_PASSWORD" +app_update 740 validate +quit'
1217
```
1318

19+
### Run CS:GO Dedicated Server
20+
21+
#### Deathmatch
22+
23+
```terminal
1424
docker run -it --net=host \
15-
-v /opt/gameservers/csgo-ds:/data \
16-
--entrypoint sh \
17-
steamcmd \
18-
-c '/data/srcds_run -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2'
25+
-v /opt/gameservers/csgo-ds:/game \
26+
saiko-tech/csgo-deathmatch \
27+
-game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2
28+
```
29+
30+
#### Surf
31+
32+
```terminal
33+
docker run -it \
34+
--net=host \
35+
--add-host=host.docker.internal:host-gateway \
36+
-v /opt/gameservers/csgo/surf/mnt:/game \
37+
-e DB_HOST=host.docker.internal \
38+
-e DB_PORT=3306 \
39+
-e DB_SCHEMA=surftimer \
40+
-e DB_USER=root \
41+
-e DB_PASS=asdqw331osfew \
42+
saiko-tech/csgo-surf \
43+
-game csgo -console -usercon -authkey 64A34280C23DC11073564B022020A46E +game_type 0 +game_mode 0 +host_workshop_collection 1561971060 +workshop_start_map 607186931
44+
```

csgo/deathmatch/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ RUN wget -q https://github.com/Maxximou5/csgo-deathmatch/releases/download/v2.0.
1010

1111
WORKDIR /home/steam
1212

13-
CMD ["-game", "csgo", "-console", "-usercon", "+game_type", "1", "+game_mode", "2", "+mapgroup", "mg_allclassic", "+map", "de_dust"]
13+
CMD ["-game", "csgo", "-console", "-usercon", "+game_type", "0", "+game_mode", "0", "+mapgroup", "mg_allclassic", "+map", "de_dust"]

csgo/kz/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM saiko-tech/sourcemod
2+
3+
ENV GAME=csgo
4+
5+
WORKDIR /home/steam/sourcemod/addons/sourcemod
6+
7+
RUN wget -qO kz.zip https://bitbucket.org/kztimerglobalteam/kztimerglobal/downloads/1.104_Full.zip \
8+
&& unzip kz.zip \
9+
&& rm kz.zip
10+
11+
WORKDIR /home/steam
12+
13+
CMD ["-game", "csgo", "-console", "-usercon", "+game_type", "0", "+game_mode", "0", "+mapgroup", "mg_allclassic", "+map", "de_dust"]

csgo/surf/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM saiko-tech/sourcemod
2+
3+
ENV GAME=csgo
4+
5+
WORKDIR /home/steam/sourcemod
6+
7+
RUN wget -qO surftimer.zip https://github.com/surftimer/SurfTimer/releases/download/1.1.2/SurfTimer.1.1.2.911.838f2a2.SM1.11.zip \
8+
&& wget -qO cleaner.zip https://github.com/accelerator74/Cleaner/releases/download/build/cleaner-sm1.10-linux-f5a6229.zip \
9+
&& wget -qO addons/sourcemod/plugins/csgo_movement_unlocker.smx https://www.sourcemod.net/vbcompiler.php?file_id=141520 \
10+
&& wget -qO addons/sourcemod/gamedata/csgo_movement_unlocker.games.txt https://forums.alliedmods.net/attachment.php?attachmentid=141521&d=1495261818 \
11+
&& wget -qO MomSurfFix.zip https://github.com/GAMMACASE/MomSurfFix/releases/download/1.1.5/MomSurfFix2v1.1.5.zip \
12+
&& wget -qO rngfix.zip https://github.com/jason-e/rngfix/releases/download/v1.1.2d/rngfix_1.1.2d.zip \
13+
&& wget -qO headbugfix.zip https://github.com/GAMMACASE/HeadBugFix/releases/download/1.0.0/headbugfix_1.0.0.zip \
14+
&& wget -qO pushfix.zip https://github.com/GAMMACASE/PushFixDE/releases/download/1.0.0/pushfix_de_1.0.0.zip \
15+
&& wget -qO addons/sourcemod/plugins/crouchboostfix.smx https://github.com/t5mat/crouchboostfix/releases/download/2.0.2/crouchboostfix.smx \
16+
&& wget -qO addons/sourcemod/plugins/runspeed.smx https://github.com/sneak-it/Normalized-Run-Speed/raw/master/plugins/runspeed.smx \
17+
&& wget -qO addons/sourcemod/gamedata/runspeed.games.txt https://raw.githubusercontent.com/sneak-it/Normalized-Run-Speed/master/gamedata/runspeed.games.txt \
18+
&& wget -qO stripper.tar.gz http://www.bailopan.net/stripper/files/stripper-1.2.2-linux.tar.gz \
19+
&& unzip surftimer.zip \
20+
&& cd addons/sourcemod \
21+
&& unzip ../../rngfix.zip \
22+
&& cd ../../ \
23+
&& unzip cleaner.zip \
24+
&& unzip MomSurfFix.zip \
25+
&& unzip -o headbugfix.zip \
26+
&& unzip -o pushfix.zip \
27+
&& tar -xzf stripper.tar.gz \
28+
&& rm *.zip
29+
30+
WORKDIR /home/steam
31+
32+
COPY databases.cfg.template start_srcds_surf.sh ./
33+
34+
ENTRYPOINT ["/home/steam/start_srcds_surf.sh"]
35+
36+
CMD ["-game", "csgo", "-console", "-usercon", "+game_type", "0", "+game_mode", "0", "+mapgroup", "mg_allclassic", "+map", "de_dust"]

csgo/surf/databases.cfg.template

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"Databases"
2+
{
3+
"driver_default" "mysql"
4+
5+
// When specifying "host", you may use an IP address, a hostname, or a socket file path
6+
7+
"default"
8+
{
9+
"driver" "default"
10+
"host" "localhost"
11+
"database" "sourcemod"
12+
"user" "root"
13+
"pass" ""
14+
//"timeout" "0"
15+
//"port" "0"
16+
}
17+
18+
"storage-local"
19+
{
20+
"driver" "sqlite"
21+
"database" "sourcemod-local"
22+
}
23+
24+
"clientprefs"
25+
{
26+
"driver" "sqlite"
27+
"host" "localhost"
28+
"database" "clientprefs-sqlite"
29+
"user" "root"
30+
"pass" ""
31+
//"timeout" "0"
32+
//"port" "0"
33+
}
34+
35+
"surftimer"
36+
{
37+
"driver" "mysql"
38+
"host" "{{DB_HOST}}"
39+
"port" "{{DB_PORT}}"
40+
"database" "{{DB_SCHEMA}}"
41+
"user" "{{DB_USER}}"
42+
"pass" "{{DB_PASS}}"
43+
}
44+
}

csgo/surf/run_dev_db.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
if [ "$(docker ps | grep surf-db)" ]; then
3+
echo surf-db is already running
4+
exit 0
5+
fi
6+
7+
if [ "$(docker ps -a | grep surf-db)" ]; then
8+
docker start surf-db
9+
else
10+
docker run \
11+
-d --name surf-db \
12+
-v /tmp/surfdb:/var/lib/mysql \
13+
-v $(pwd)/surftimer.sql:/docker-entrypoint-initdb.d/1.sql \
14+
-e MYSQL_ROOT_PASSWORD=asdqw331osfew \
15+
-e MYSQL_DATABASE=surftimer \
16+
-p 3306:3306 \
17+
mariadb:10.5 \
18+
--default-authentication-plugin=mysql_native_password
19+
fi

csgo/surf/start_srcds_surf.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
if [ -z "$DB_HOST" ] || [ -z "$DB_PORT" ] || [ -z "$DB_SCHEMA" ] || [ -z "$DB_USER" ] || [ -z "$DB_PASS" ] ; then
6+
echo "DB_HOST, DB_PORT, DB_SCHEMA, DB_USER & DB_PASS env vars must be set"
7+
exit 1
8+
fi
9+
10+
cp /home/steam/databases.cfg.template /tmp/databases.cfg
11+
sed -i "s#{{DB_HOST}}#$DB_HOST#" /tmp/databases.cfg
12+
sed -i "s#{{DB_PORT}}#$DB_PORT#" /tmp/databases.cfg
13+
sed -i "s#{{DB_SCHEMA}}#$DB_SCHEMA#" /tmp/databases.cfg
14+
sed -i "s#{{DB_USER}}#$DB_USER#" /tmp/databases.cfg
15+
sed -i "s#{{DB_PASS}}#$DB_PASS#" /tmp/databases.cfg
16+
mv /tmp/databases.cfg /home/steam/sourcemod/addons/sourcemod/configs/databases.cfg
17+
18+
exec /home/steam/start_srcds_sm.sh $@

0 commit comments

Comments
 (0)