Compare commits
4 Commits
3f4d62daac
...
83ef311fec
| Author | SHA1 | Date | |
|---|---|---|---|
| 83ef311fec | |||
| 248559cc4a | |||
| 4a3e7ad0c7 | |||
| 19e1f366c8 |
@@ -3,4 +3,6 @@ RUN mkdir -p /home/steam/server
|
|||||||
COPY start.sh /home/steam/start.sh
|
COPY start.sh /home/steam/start.sh
|
||||||
VOLUME "/home/steam/server"
|
VOLUME "/home/steam/server"
|
||||||
WORKDIR /home/steam/
|
WORKDIR /home/steam/
|
||||||
|
ENV METAMOD_DL_URL "https://mms.alliedmods.net/mmsdrop/1.11/mmsource-1.11.0-git1145-linux.tar.gz"
|
||||||
|
ENV SOURCEMOD_DL_URL "https://sm.alliedmods.net/smdrop/1.10/sourcemod-1.10.0-git6524-linux.tar.gz"
|
||||||
ENTRYPOINT /home/steam/start.sh
|
ENTRYPOINT /home/steam/start.sh
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
Left 4 dead 2 server.
|
Left 4 dead 2 server. With Metamod and Sourcemod.
|
||||||
|
|
||||||
|
[Github](https://github.com/Djeeberjr/l4d2-docker)
|
||||||
|
|
||||||
# Ports
|
# Ports
|
||||||
- 27015
|
- 27015
|
||||||
@@ -15,3 +17,8 @@ So for example to set the RCON password set the enviroment variable `CVAR_RCON_P
|
|||||||
Try to avoid variables with the word `CVAR_` and avoid `=` in it.
|
Try to avoid variables with the word `CVAR_` and avoid `=` in it.
|
||||||
|
|
||||||
A list of available cvars can be found [here](https://developer.valvesoftware.com/wiki/List_of_L4D2_Cvars).
|
A list of available cvars can be found [here](https://developer.valvesoftware.com/wiki/List_of_L4D2_Cvars).
|
||||||
|
|
||||||
|
Add your steam ids to `SM_ADMIN` to be added as a sourcemod admin.
|
||||||
|
|
||||||
|
If there is a new version of Metamod or Sourcemod and is not yet set in the image you can manually set the download URL in `METAMOD_DL_URL` and `SOURCEMOD_DL_URL`.
|
||||||
|
It will only get update if the addon directory is empty.
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ services:
|
|||||||
- CVAR_HOSTNAME=My left 4 dead server
|
- CVAR_HOSTNAME=My left 4 dead server
|
||||||
- CVAR_RCON_PASSWORD=password123
|
- CVAR_RCON_PASSWORD=password123
|
||||||
- CVAR_SV_ALLOW_LOBBY_CONNECT_ONLY=0
|
- CVAR_SV_ALLOW_LOBBY_CONNECT_ONLY=0
|
||||||
- CVAR_SV_CONSISTENCY=1
|
- CVAR_SV_CONSISTENCY=0
|
||||||
- CAVR_SV_VOICEENABLE=1
|
- CAVR_SV_VOICEENABLE=1
|
||||||
- CVAR_MP_DISABLE_AUTOKICK=1
|
- CVAR_MP_DISABLE_AUTOKICK=1
|
||||||
|
- SM_ADMIN=STEAM_0:1:123,STEAM_0:1:456
|
||||||
|
- INSECURE=true
|
||||||
- "MOTD_FILE_CONTENT=Put your MODT here. \n
|
- "MOTD_FILE_CONTENT=Put your MODT here. \n
|
||||||
Multiline is also supported."
|
Multiline is also supported."
|
||||||
- "HOST_FILE_CONTENT=Same with the host file \n
|
- "HOST_FILE_CONTENT=Same with the host file \n
|
||||||
|
|||||||
34
start.sh
34
start.sh
@@ -2,7 +2,30 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir "$HOME/server" +app_update 222860 validate +quit
|
/home/steam/steamcmd/steamcmd.sh +login anonymous +force_install_dir "$HOME/server" +app_update 222860 +quit
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -e "$HOME/server/left4dead2/addons/metamod.vdf" ]; then
|
||||||
|
echo "Installing Metamod"
|
||||||
|
curl "$METAMOD_DL_URL" -o /tmp/metamod.tar.gz
|
||||||
|
tar -xf /tmp/metamod.tar.gz -C "$HOME/server/left4dead2"
|
||||||
|
rm /tmp/metamod.tar.gz
|
||||||
|
|
||||||
|
echo "Install Sourcemod"
|
||||||
|
curl "$SOURCEMOD_DL_URL" -o /tmp/sourcemod.tar.gz
|
||||||
|
tar -xf /tmp/sourcemod.tar.gz -C "$HOME/server/left4dead2"
|
||||||
|
rm /tmp/sourcemod.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
mkdir -p "$HOME/server/left4dead2/addons/sourcemod/configs/"
|
||||||
|
echo "// Autogenerated. DO NOT EDIT. Sourcemod admin can be added with the SM_ADMIN environment variable" \
|
||||||
|
> "$HOME/server/left4dead2/addons/sourcemod/configs/admins_simple.ini"
|
||||||
|
for id in $(echo "$SM_ADMIN" | sed 's/,/\n/g')
|
||||||
|
do
|
||||||
|
echo "\"$id\" \"99:z\"" >> "$HOME/server/left4dead2/addons/sourcemod/configs/admins_simple.ini"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
echo -n "$MOTD_FILE_CONTENT" > "$HOME/server/left4dead2/motd.txt"
|
echo -n "$MOTD_FILE_CONTENT" > "$HOME/server/left4dead2/motd.txt"
|
||||||
|
|
||||||
@@ -12,4 +35,11 @@ env | awk -F "=" '/^CVAR_/ {sub("CVAR_","",$1); print tolower($1),($2 ~ /^[0-9]+
|
|||||||
|
|
||||||
cat /home/steam/server/left4dead2/cfg/server.cfg
|
cat /home/steam/server/left4dead2/cfg/server.cfg
|
||||||
|
|
||||||
"$HOME/server/srcds_run" -console -game left4dead2 +maxplayers 16 -maxclients 16 -ip 0.0.0.0
|
SRCDS_ARGS=""
|
||||||
|
|
||||||
|
if [ -n "$INSECURE" ]; then
|
||||||
|
SRCDS_ARGS="${SRCDS_ARGS} -insecure"
|
||||||
|
echo "Running with VAC disabled."
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$HOME/server/srcds_run" -console -game left4dead2 +maxplayers 16 -maxclients 16 -ip 0.0.0.0 $SRCDS_ARGS
|
||||||
|
|||||||
Reference in New Issue
Block a user