This commit is contained in:
kento2 2026-08-18 19:19:33 +02:00
parent dede9ce18d
commit 15f60f0465
7 changed files with 111 additions and 270 deletions

View file

@ -5,10 +5,56 @@ job "lobby" {
count = 1
network {
mode = "host"
mode = "bridge"
port "minecraft" {
to = 25565
}
dns {
servers = ["172.17.0.1"]
}
}
service {
name = "lobby"
port = "minecraft"
address_mode = "alloc"
check {
type = "tcp"
interval = "5s"
timeout = "1s"
}
}
ephemeral_disk {
size = 5000 # 5 gb
}
task "download-plugins" {
driver = "docker"
lifecycle {
hook = "prestart"
sidecar = false
}
config {
image = "busybox"
command = "sh"
volumes = ["../alloc/data:/mnt"]
args = [
"-xec",
<<-EOF
mkdir -p /mnt/plugins
cd /mnt/plugins
wget \
https://git.lab0x13.site/api/packages/scrow/generic/core-bukkit/UNVERSIONED/CoreBukkit.jar \
https://download.luckperms.net/1652/bukkit/loader/LuckPerms-Bukkit-5.5.65.jar \
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaVersion/versions/5.11.0/PAPER/ViaVersion-5.11.0.jar \
https://hangarcdn.papermc.io/plugins/ViaVersion/ViaBackwards/versions/5.11.0/PAPER/ViaBackwards-5.11.0.jar
ls -l
EOF
]
}
}
task "run" {
@ -18,9 +64,9 @@ job "lobby" {
image = "git.lab0x13.site/scrow/papermc:0.1"
force_pull = false
ports = ["minecraft"]
#args = ["java", "-jar", "server.jar", "--port=${NOMAD_PORT_minecraft}"]
volumes = ["../alloc/data:/mnt"]
}
env {
HOST_POSTGRES = "jdbc:postgresql://postgres.service.consul/scrow"
HOST_NATS = "nats://nats.service.consul"
@ -30,18 +76,6 @@ job "lobby" {
cpu = 1000
memory = 2048
}
service {
name = "lobby"
port = "minecraft"
provider = "consul"
check {
type = "tcp"
interval = "5s"
timeout = "1s"
}
}
}
}
}