From c9b1ea69c96e1d30bca7739fd73dcda241730178 Mon Sep 17 00:00:00 2001 From: James Hackett Date: Mon, 15 May 2023 23:21:57 +0100 Subject: [PATCH] Add minecraft servers and update traefik to allow users to connect --- jobs/minecraft.hcl | 31 +++++++++---------------------- jobs/traefik.hcl | 10 +++++----- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/jobs/minecraft.hcl b/jobs/minecraft.hcl index fc4cfc9..ceef672 100644 --- a/jobs/minecraft.hcl +++ b/jobs/minecraft.hcl @@ -1,8 +1,8 @@ -job "create-astral" { +job "minecraft" { datacenters = ["aperture"] type = "service" - group "mc" { + group "vanilla" { constraint { attribute = "${attr.unique.hostname}" value = "glados" @@ -29,6 +29,9 @@ job "create-astral" { config { image = "itzg/minecraft-server" ports = ["mc-vanilla-port","mc-vanilla-rcon"] + volumes = [ + "/storage/nomad/${NOMAD_TASK_NAME}:/data/world" + ] } resources { @@ -43,12 +46,7 @@ job "create-astral" { } } - group "mc-astral" { - constraint { - attribute = "${attr.unique.hostname}" - value = "glados" - } - + group "create-astral" { count = 1 network { port "mc-astral-port" { @@ -68,32 +66,21 @@ job "create-astral" { task "minecraft-astral" { driver = "docker" config { - image = "itzg/minecraft-server" + image = "ghcr.io/maxi0604/create-astral:main" ports = ["mc-astral-port","mc-astral-rcon"] volumes = [ - "data:/data" + "/storage/nomad/${NOMAD_TASK_NAME}:/data/world" ] } resources { cpu = 3000 # 500 MHz - memory = 6144 # 6gb + memory = 8168 # 8gb } env { EULA = "TRUE" MEMORY = "6G" - TYPE = "FORGE" - VERSION = "1.18.2" - CF_SERVER_MOD = "modpack.zip" - } - - artifact { - source = "http://10.10.0.5:8000/modpack.zip" - destination = "/data" - options { - archive = false - } } } } diff --git a/jobs/traefik.hcl b/jobs/traefik.hcl index fa1933e..8814d31 100644 --- a/jobs/traefik.hcl +++ b/jobs/traefik.hcl @@ -35,11 +35,11 @@ job "traefik" { template { data = <