From 709bfd13236c63a6d0753198f65736565fb85b54 Mon Sep 17 00:00:00 2001 From: wizzdom Date: Fri, 19 Jan 2024 03:54:43 +0000 Subject: [PATCH] add gamessoc minecraft server --- jobs/mc-router.hcl | 2 ++ jobs/minecraft.hcl | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/jobs/mc-router.hcl b/jobs/mc-router.hcl index fc34872..d18b34e 100644 --- a/jobs/mc-router.hcl +++ b/jobs/mc-router.hcl @@ -57,6 +57,8 @@ config: backend: vanilla-mc.service.consul:25567 - host: shemek.rb.dcu.ie backend: shemek-mc.service.consul:25568 + - host: games.rb.dcu.ie + backend: games-mc.service.consul:25569 EOH destination = "local/file.conf" } diff --git a/jobs/minecraft.hcl b/jobs/minecraft.hcl index 61d1459..2875120 100644 --- a/jobs/minecraft.hcl +++ b/jobs/minecraft.hcl @@ -44,6 +44,51 @@ job "minecraft" { } } + group "games-mc" { + count = 1 + + network { + port "mc-games-port" { + static = 25569 + to = 25565 + } + + port "mc-games-rcon" { + to = 25575 + } + } + + service { + name = "games-mc" + } + + task "minecraft-games" { + driver = "docker" + + config { + image = "itzg/minecraft-server" + ports = ["mc-games-port","mc-games-rcon"] + + volumes = [ + "/storage/nomad/${NOMAD_TASK_NAME}:/data" + ] + } + + resources { + cpu = 7000 # 7000 MHz + memory = 17408 # 17GB + } + + env { + EULA = "TRUE" + TYPE = "PURPUR" + VERSION = "1.20.1" + MOTD = "DCU Games Minecraft Server" + OPS = "" + } + } + } + group "fugitives-mc" { count = 1