From 4fe992adf594b59b1b27bc591551686c0c887579 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Sat, 6 Jan 2024 00:09:10 +0000 Subject: [PATCH] Add another minecraft server --- jobs/mc-router.hcl | 2 ++ jobs/minecraft.hcl | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/jobs/mc-router.hcl b/jobs/mc-router.hcl index 2b16e33..fc34872 100644 --- a/jobs/mc-router.hcl +++ b/jobs/mc-router.hcl @@ -55,6 +55,8 @@ config: backend: fugitives-mc.service.consul:25566 - host: mc.rb.dcu.ie backend: vanilla-mc.service.consul:25567 + - host: shemek.rb.dcu.ie + backend: shemek-mc.service.consul:25568 EOH destination = "local/file.conf" } diff --git a/jobs/minecraft.hcl b/jobs/minecraft.hcl index 9531e5c..ad1354e 100644 --- a/jobs/minecraft.hcl +++ b/jobs/minecraft.hcl @@ -75,4 +75,58 @@ job "minecraft" { } } } + + group "shemek-mc" { + count = 1 + + network { + port "mc-shemek-port" { + static = 25568 + to = 25565 + } + + port "mc-shemek-rcon" { + to = 25575 + } + } + + service { + name = "shemek-mc" + } + + task "minecraft-shemek" { + driver = "docker" + + config { + image = "itzg/minecraft-server" + ports = ["mc-shemek-port","mc-shemek-rcon"] + + volumes = [ + "/storage/nomad/${NOMAD_TASK_NAME}:/data" + ] + } + + resources { + cpu = 7000 # 7000 MHz + memory = 17408 # 17GB + } + + env { + EULA = "TRUE" + TYPE = "FORGE" + VERSION = "1.20.1" + FORGE_INSTALLER = "forge-1.20.1-47.2.19-installer.jar" + OVERRIDE_SERVER_PROPERTIES = "TRUE" + JVM_XX_OPTS = "-Xms12G -Xmx16G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1" + MAX_MEMORY = "16G" + MAX_PLAYERS = "5" + MOTD = "Minecraft ATM 9" + DIFFICULTY = "normal" + SPAWN_PROTECTION = "0" + ENFORCE_WHITELIST = "true" + WHITELIST = "Shmickey02" + OPS = "Shmickey02" + } + } + } }