homelab/nomad-job/syncthing.nomad
2022-12-10 17:10:32 +01:00

58 lines
1.1 KiB
HCL

job "syncthing" {
datacenters = ["homelab"]
priority = 70
type = "service"
meta {
forcedeploy = "0"
}
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
}
group "syncthing" {
network {
mode = "host"
port "http" {
to = 8384
}
port "listen" {
static = 22000
}
port "discovery" {
static = 21027
}
}
task "syncthing" {
driver = "docker"
service {
name = "syncthing-web"
port = "http"
tags = [
"homer.enable=true",
"homer.name=Syncthing",
"homer.service=Application",
"homer.logo=http://${NOMAD_ADDR_http}/assets/img/logo-horizontal.svg",
"homer.target=_blank",
"homer.url=http://${NOMAD_ADDR_http}",
]
}
config {
image = "linuxserver/syncthing"
ports = ["http"]
volumes = [
"/mnt/diskstation/nomad/syncthing/config:/config",
"/mnt/diskstation/nomad/syncthing/data:/data1"
]
}
resources {
memory = 200
}
}
}
}