diff --git a/.dockerignore b/.dockerignore index c647ea4..7f0c88d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1 @@ -csgo-data \ No newline at end of file +csgo-data* diff --git a/.gitignore b/.gitignore index c647ea4..197d815 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -csgo-data \ No newline at end of file +csgo-data* +inventory* diff --git a/cs_aws.sh b/cs_aws.sh old mode 100644 new mode 100755 index de13c96..4c4524c --- a/cs_aws.sh +++ b/cs_aws.sh @@ -1,3 +1,6 @@ +#!/bin/sh +set -eux + # Install Docker sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common -y @@ -12,39 +15,18 @@ sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker- sudo chmod +x /usr/local/bin/docker-compose docker-compose --version -# Clone repo locally -mkdir ~/cs_server_1/ -git clone https://github.com/FragSoc/csgo-server-scrim.git ~/cs_server_1/. -mkdir ~/cs_server_2/ -git clone https://github.com/FragSoc/csgo-server-scrim.git ~/cs_server_2/. - -# Configure ports and source tokens -sed -i 's/SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E/SRCDS_TOKEN=3C1836105A719D05E6E2377A823F66E1/g' ~/cs_server_1/docker-compose.yml - -sed -i 's/SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E/SRCDS_TOKEN=5BA590C6B96839FC248667027F2E8D79/g' ~/cs_server_2/docker-compose.yml -sed -i 's/SRCDS_PORT=27015/SRCDS_PORT=27016/g' ~/cs_server_2/docker-compose.yml -sed -i 's/SRCDS_TV_PORT=27020/SRCDS_TV_PORT=27021/g' ~/cs_server_2/docker-compose.yml - # Configure passwords -sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #1"/g' ~/cs_server_1/custom_server_template.cfg -sed -i 's/sv_password "default"/sv_password "z6gMtKvm"/g' ~/cs_server_1/custom_server_template.cfg -sed -i 's/rcon_password "default"/rcon_password "6zzPYFwQ"/g' ~/cs_server_1/custom_server_template.cfg +# sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #1"/g' ~/cs_server_1/custom_server_template.cfg +# sed -i 's/sv_password "default"/sv_password "z6gMtKvm"/g' ~/cs_server_1/custom_server_template.cfg +# sed -i 's/rcon_password "default"/rcon_password "6zzPYFwQ"/g' ~/cs_server_1/custom_server_template.cfg -sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #2"/g' ~/cs_server_2/custom_server_template.cfg -sed -i 's/sv_password "default"/sv_password "mLMQ7LgM"/g' ~/cs_server_2/custom_server_template.cfg -sed -i 's/rcon_password "default"/rcon_password "zuKUW8wR"/g' ~/cs_server_2/custom_server_template.cfg +# sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #2"/g' ~/cs_server_2/custom_server_template.cfg +# sed -i 's/sv_password "default"/sv_password "mLMQ7LgM"/g' ~/cs_server_2/custom_server_template.cfg +# sed -i 's/rcon_password "default"/rcon_password "zuKUW8wR"/g' ~/cs_server_2/custom_server_template.cfg -# Make install directory -mkdir ~/cs_server_1/csgo-data -chmod 777 ~/cs_server_1/csgo-data -mkdir ~/cs_server_2/csgo-data -chmod 777 ~/cs_server_2/csgo-data +# Make install directories +install -m 0777 -d ./csgo-data1 +install -m 0777 -d ./csgo-data2 # Run container composes -sudo docker-compose -f ~/cs_server_1/docker-compose.yml up -d -sudo docker-compose -f ~/cs_server_2/docker-compose.yml up -d - - -# rsync -av csgo-server-scrim/ csgo-server-scrim_2/ - - +sudo docker-compose up -d diff --git a/docker-compose.yml b/docker-compose.yml index 9755602..fb58942 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,28 @@ -version: "3" -services: - csgo-scrim: +version: "3.4" + +x-defaults: &defaults build: . - volumes: - - ./csgo-data:/home/steam/csgo-dedicated/ + image: fragsoc/csgo-server-scrim network_mode: "host" - environment: - - SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E + restart: unless-stopped + +services: + scrim1: + <<: *defaults + volumes: + - ./csgo-data1:/home/steam/csgo-dedicated/ + environment: + - SRCDS_TOKEN=3C1836105A719D05E6E2377A823F66E1 - SRCDS_PORT=27015 - SRCDS_TV_PORT=27020 - SCRIM=true # Set false for a team structured config + + scrim2: + <<: *defaults + volumes: + - ./csgo-data1:/home/steam/csgo-dedicated/ + environment: + - SRCDS_TOKEN=5BA590C6B96839FC248667027F2E8D79 + - SRCDS_PORT=27016 + - SRCDS_TV_PORT=27021 + - SCRIM=true # Set false for a team structured config