I would like to run a TTT (Trouble in Terrorist Town) server on my own server. I would like to implement this with a Docker container. The server is displayed to me, but there is no password query or anything else. Because after a while it always says "Connection failed after
Creating Docker Container with docker-compose.yml:
version: '3.8'
services:
ttt:
container_name: ttt-server
build:
context: .
dockerfile: Dockerfile
ports:
# Port 27016 because my ARK-Server use 27015
- "27016:27015/tcp"
- "27016:27015/udp"
- "27005:27005/tcp"
- "27005:27005/udp"
volumes:
- tttserver:/home/steam
command: tail -f /dev/null
volumes:
tttserver:
Dockerfile:
FROM ubuntu:18.04
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update --fix-missing && \
apt-get install -y \
software-properties-common \
wget \
curl \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN apt-get upgrade -y
RUN apt-get update -y
RUN apt-get install -y \
sudo \
nano
RUN echo "root:<password>" | chpasswd
RUN sudo useradd -m steam
RUN sudo usermod -aG sudo steam
RUN echo "steam:<steampassword>" | chpasswd
RUN sudo -u steam -H -s
RUN sudo add-apt-repository multiverse; sudo dpkg --add-architecture i386; sudo apt update -y
RUN echo steam steam/question select "I AGREE" | sudo debconf-set-selections
RUN echo steam steam/license note '' | sudo debconf-set-selections
RUN sudo apt install steamcmd -y
RUN sudo apt-get install --reinstall ca-certificates -y
RUN /usr/games/steamcmd \
+login anonymous \
+force_install_dir /home/steam/tttserver \
+app_update 4020 validate \
+quit
RUN echo 'gamemode terrortown' > /home/steam/tttserver/garrysmod/cfg/autoexec.cfg
RUN echo '#!/bin/bash' > /home/steam/tttserver/startServer.sh
RUN echo './srcds_run -console -maxplayers 16 -game garrysmod +gamemode terrortown +map gm_construct' >> /home/steam/tttserver/startServer.sh
WORKDIR /home/steam/tttserver
RUN chmod +x startServer.sh
COPY ./server.cfg /home/steam/tttserver/garrysmod/cfg/server.cfg
WORKDIR /home/steam/tttserver
CMD ["/bin/bash"]
The "server.cfg"
hostname "<severname>"
rcon_password "<rcon-password>"
sv_password "<serverpassword>"
//DNA
ttt_killer_dna_range 300
ttt_killer_dna_basetime 100
//Prep
ttt_firstpreptime 45
ttt_preptime_seconds 30
ttt_posttime_seconds 10
//Round length
ttt_haste 0
// ttt_haste_starting_minutes 5
// ttt_haste_minutes_per_death 0.5
ttt_roundtime_minutes 10
//Map Switching
ttt_round_limit 4
ttt_time_limit_minutes 75
//ttt_always_use_mapcycle 0
//Player Counts
ttt_minimum_players 2
ttt_traitor_pct 0.33
ttt_traitor_max 32
ttt_detective_pct 0.13
ttt_detective_max 32
ttt_detective_min_players 5
ttt_detective_karma_min 600
//Karma
ttt_karma 1
ttt_karma_strict 1
ttt_karma_starting 1000
ttt_karma_max 1000
ttt_karma_ratio 0.001
ttt_karma_kill_penalty 15
ttt_karma_round_increment 5
ttt_karma_clean_bonus 30
ttt_karma_traitordmg_ratio 0.0003
ttt_karma_traitorkill_bonus 40
ttt_karma_low_autokick 1
ttt_karma_low_amount 300
ttt_karma_low_ban 0
ttt_karma_low_ban_minutes 60
ttt_karma_persist 1
ttt_karma_clean_half 0.25
//Other
ttt_postround_dm 1
ttt_no_nade_throw_during_prep 0
ttt_weapon_carrying 1
ttt_weapon_carrying_range 50
ttt_teleport_telefrags 1
ttt_ragdoll_pinning 1
ttt_ragdoll_pinning_innocents 1
ttt_use_weapon_spawn_scripts 1
ttt_spawn_wave_interval 2
// server logging
log on
sv_logbans 1
sv_logecho 1
sv_logfile 1
sv_log_onefile 0
// operation
sv_lan 0
sv_region 255
exec banned_user.cfg
exec banned_ip.cfg
..................................................................... These are all the settings and configurations that I have done so far
After building the container, I start the server by running the “startServer.sh” script
Logs
************** WARNING ***************
Running the dedicated server as root
is highly discouraged. It is generally
unnecessary to use root privileges to
execute the dedicated server.
**************************************
Auto detecting CPUntinue to launch in 1 secondss
Using default binary: ./srcds_linux
Server will auto-restart if there is a crash.
WARNING: Failed to load 32-bit libtinfo.so.5 or libncurses.so.5.
Please install (lib32tinfo5 / ncurses-libs.i686 / equivalent) to enable readline.
Couldn't load shader dll: game_shader_generic_garrysmod_srv.soConVarRef mat_dxlevel doesn't point to an existing ConVar
Game_srv.so loaded for "Garry's Mod"
Setting breakpad minidump AppID = 4000
Initializing Steam libraries for Workshop..
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 3 milliseconds to initialize
dlmopen steamservice.so failed: steamservice.so: cannot open shared object file: No such file or directory
SteamInternal_SetMinidumpSteamID: Caching Steam ID: ##Censored## [API loaded no]
[S_API FAIL] Tried to access Steam interface SteamUser023 before SteamAPI_Init succeeded.
WS: No +host_workshop_collection or it is invalid!
Unknown command "cl_cmdrate"
Unknown command "cl_updaterate"
Unknown command "rate"
Changing gamemode to Trouble in Terrorist Town (terrortown)
Network: IP ##Censored##, mode MP, dedicated Yes, ports 27015 SV / 27005 CL
Error loading cfg/trusted_keys_base.txt
Error loading cfg/pure_server_minimal.txt
PREP OK
Included TTT language file: brazilian_portuguese.lua
Included TTT language file: chef.lua
Included TTT language file: english.lua
Included TTT language file: french.lua
Included TTT language file: german.lua
Included TTT language file: italian.lua
Included TTT language file: japanese.lua
Included TTT language file: russian.lua
Included TTT language file: simpchinese.lua
Included TTT language file: spanish.lua
Included TTT language file: swedish.lua
Included TTT language file: tradchinese.lua
Included TTT language file: ukrainian.lua
Trouble In Terrorist Town gamemode initializing...
ConVarRef room_type doesn't point to an existing ConVar
Executing dedicated server config file server.cfg
Using map cycle file cfg/mapcycle.txt.
Initializing Steam libraries for secure Internet server
[S_API] SteamAPI_Init(): Loaded local 'steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 2 milliseconds to initialize
dlmopen steamservice.so failed: steamservice.so: cannot open shared object file: No such file or directory
SteamInternal_SetMinidumpSteamID: Caching Steam ID: ##Censored## [API loaded no]
No account token specified; logging into anonymous game server account. (Use sv_setsteamaccount to login to a p ersistent account.)
Server ranking in server browser will be negatively impacted due to sv_setsteamaccount not being set.
Server logging enabled.
Server logging data to file logs/L0229001.log
L 02/29/2024 - 15:01:19: Log file started (file "logs/L0229001.log") (game "garrysmod") (version "9040")
'banned_user.cfg' not present; not executing.
'banned_ip.cfg' not present; not executing.
Connection to Steam servers successful.
Public IP is ##Censored##.
Assigned anonymous gameserver Steam ID [A-1:##Censored##].
VAC secure mode is activated.
