From a5dab84d7319a0e40b0b6897b7d424a031d78935 Mon Sep 17 00:00:00 2001 From: galinette-34 <62066654+galinette-34@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:58:09 +0200 Subject: [PATCH 1/3] Update Dockerfile to set variable CS2_IP The variable CS2_IP will be used in entry.sh for cs2 parameter "-ip" to set the tcp listener to a specific ip address. default: 0.0.0.0 (listen to all IPs on the local machine) is probably the best. left blank: cs2 try to identify the current ip automatically --- bullseye/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/bullseye/Dockerfile b/bullseye/Dockerfile index 470ca3b..7de34a6 100644 --- a/bullseye/Dockerfile +++ b/bullseye/Dockerfile @@ -33,6 +33,7 @@ RUN set -x \ FROM build_stage AS bullseye-base ENV CS2_SERVERNAME="cs2 private server" \ + CS2_IP=0.0.0.0 \ CS2_PORT=27015 \ CS2_MAXPLAYERS=10 \ CS2_RCONPW="changeme" \ From 018d09ae971800408463f5b710b7a8f3254e5bac Mon Sep 17 00:00:00 2001 From: galinette-34 <62066654+galinette-34@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:04:20 +0200 Subject: [PATCH 2/3] Update entry.sh use environment variable CS2_IP for cs2 parameter "-ip", to set tcp listener to a specific ip address. --- bullseye/etc/entry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bullseye/etc/entry.sh b/bullseye/etc/entry.sh index f4c26b6..837b234 100644 --- a/bullseye/etc/entry.sh +++ b/bullseye/etc/entry.sh @@ -47,7 +47,7 @@ fi # Start Server eval "./cs2" -dedicated \ - -port "${CS2_PORT}" \ + -ip "${CS2_IP}" -port "${CS2_PORT}" \ -console \ -usercon \ -maxplayers_override "${CS2_MAXPLAYERS}" \ From 1705aa342cb7d965714677ad397e068cc489fe57 Mon Sep 17 00:00:00 2001 From: galinette-34 <62066654+galinette-34@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:11:20 +0200 Subject: [PATCH 3/3] Update README.md description for environment variable CS2_IP --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8e3aff4..93c9c96 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ STEAMGUARD="" (Optional, Steam Guard key if enabled. Use your most ```dockerfile CS2_SERVERNAME="changeme" (Set the visible name for your private server) +CS2_IP=0.0.0.0 (CS2 server listening IP address, 0.0.0.0 - all IP addresses on the local machine, empty - IP identified automatically) CS2_PORT=27015 (CS2 server listen port tcp_udp) CS2_LAN="0" (0 - LAN mode disabled, 1 - LAN Mode enabled) CS2_RCONPW="changeme" (RCON password)