diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c33e7cb --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +# Server vars +SERVER_NAME=My CSDM Server +RCON_PASSWORD=changeme +PORT = 27015 +HLTV_PORT = 27020 +VAC = "secure" +SV_LAN = 0 + +# Gameplay settings +START_MAP = "de_dust2" +MAX_PLAYERS = 32 diff --git a/docker-compose.yml b/docker-compose.yml index 35db9ae..39a8262 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,16 @@ services: csdm_1: build: . - container_name: csdm-1 + container_name: csdm ports: - - "27015:27015/udp" - - "27020:27020/udp" + - "${PORT}:${PORT}/udp" + - "${HLTV_PORT}:${HLTV_PORT}/udp" restart: unless-stopped environment: - MAP: "de_dust2" - MAXPLAYERS: "32" - PORT: "27015" - HLTV_PORT: "27020" - RCON_PASSWORD: "bro1337" - SV_LAN: "0" - VAC: "insecure" \ No newline at end of file + MAP: "${START_MAP}" + MAXPLAYERS: "${MAX_PLAYERS}" + PORT: "${PORT}" + HLTV_PORT: "${HLTV_PORT}" + RCON_PASSWORD: "${RCON_PASSWORD}" + SV_LAN: "${SV_LAN}" + VAC: "${VAC}" \ No newline at end of file diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..5e4a384 --- /dev/null +++ b/init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +ENV_FILE=".env" + +if [ -f "$ENV_FILE" ]; then + echo "[INFO] $ENV_FILE already exists. Skipping." +else + echo "[INFO] Creating $ENV_FILE from .env.example" + cp .env.example .env + echo "[OK] Now you can edit .env if needed." +fi