From e1e79362c5987c6316ab8849b467260b0e779a6f Mon Sep 17 00:00:00 2001 From: James Hackett Date: Thu, 4 Jan 2024 01:40:33 +0000 Subject: [PATCH] Allow multiple minecraft servers on one port --- jobs/mc-router.hcl | 61 ++++++++++++++++++++++ jobs/minecraft.hcl | 110 +++++++++++++++++++++------------------- jobs/user-vms/README.md | 0 3 files changed, 118 insertions(+), 53 deletions(-) create mode 100644 jobs/mc-router.hcl mode change 100755 => 100644 jobs/user-vms/README.md diff --git a/jobs/mc-router.hcl b/jobs/mc-router.hcl new file mode 100644 index 0000000..217a47d --- /dev/null +++ b/jobs/mc-router.hcl @@ -0,0 +1,61 @@ +job "mc-router" { + datacenters = ["aperture"] + + type = "service" + + constraint { + attribute = "${attr.unique.hostname}" + value = "bastion-vm" + } + + group "mc-router" { + count = 1 + + network { + port "mc" { + static = 4501 + } + } + + service { + port = "mc" + + check { + type = "tcp" + interval = "10s" + timeout = "2s" + } + } + + task "webserver" { + driver = "docker" + + config { + image = "ghcr.io/minekube/gate" + ports = ["mc"] + + volumes = [ + "local/file.conf:/config.yaml" + ] + } + + template { + data = <