From 6f481d441b5c056690091f611ce6d339932b0f60 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sat, 20 Apr 2024 16:55:44 +0200 Subject: [PATCH] This may or may not work --- .env | 2 ++ docker-compose.yml | 10 +++++----- rcon.sh | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..6deb8ba --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +SERVICE_NAME=mcsd +NETWORK_NAME=mcsdnet diff --git a/docker-compose.yml b/docker-compose.yml index ffb86c6..6c7d6e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ services: - mcsd: + ${SERVICE_NAME}: build: . - container_name: mcsd + container_name: ${SERVICE_NAME} restart: unless-stopped stop_grace_period: 120s volumes: @@ -11,9 +11,9 @@ services: ports: - 25565:25565 networks: - - mcsdnet + - ${NETWORK_NAME} networks: - mcsdnet: - name: mcsdnet + ${NETWORK_NAME}: + name: ${NETWORK_NAME} external: false diff --git a/rcon.sh b/rcon.sh index 3fa51c0..1751e25 100644 --- a/rcon.sh +++ b/rcon.sh @@ -1,2 +1,3 @@ #!/bin/bash -docker compose exec -it mcsd rcon -a 127.0.0.1:25575 -p mcsdrcon +source .env +docker compose exec -it ${SERVICE_NAME} rcon -a 127.0.0.1:25575 -p mcsdrcon