homelab/nomad-job/syncthing.nomad
vincent e0f9190b76
Some checks failed
continuous-integration/drone/push Build is failing
feat: docker pull througt mirror
2024-03-17 18:58:24 +01:00

62 lines
1.2 KiB
HCL

job "syncthing" {
datacenters = ["homelab"]
priority = 70
type = "service"
meta {
forcedeploy = "0"
}
constraint {
attribute = "${attr.cpu.arch}"
value = "amd64"
}
constraint {
attribute = "${node.class}"
operator = "set_contains"
value = "cluster"
}
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 = "docker.service.consul:5000/linuxserver/syncthing"
ports = ["http"]
volumes = [
"/mnt/diskstation/nomad/syncthing/config:/config",
"/mnt/diskstation/nomad/syncthing/data:/data1"
]
}
resources {
memory = 200
}
}
}
}