Files
alo-cluster/services/weewx.hcl

88 lines
1.7 KiB
HCL

job "weewx" {
datacenters = ["alo"]
meta {
uuid = uuidv4()
}
group "weather" {
network {
port "http" {
}
port "osweather" {
static = 20080
to = 80
}
}
task "backend" {
driver = "docker"
config {
image = "gitea.v.paler.net/ppetru/weewx:latest"
# to be able to receive UDP broadcast packets from the weatherlink
network_mode = "host"
volumes = [
"/data/services/weewx/etc:/etc/weewx",
"/data/services/weewx/html:/var/www/html",
]
}
resources {
memory = 1024
}
}
task "frontend" {
driver = "docker"
config {
image = "pierrezemb/gostatic"
ports = [ "http" ]
args = [
"-port=${NOMAD_PORT_http}",
"-enable-health",
]
volumes = [ "/data/services/weewx/html:/srv/http" ]
}
}
task "osweather" {
driver = "docker"
config {
image = "gitea.v.paler.net/ppetru/opensprinkler-weather:latest"
ports = [ "osweather" ]
}
}
service {
name = "weather"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.weather.entryPoints=websecure,web4proxy",
"traefik.http.routers.weather.rule=Host(`weewx.v.paler.net`) || (Host(`alo.land`) && PathPrefix(`/weather`))",
"traefik.http.routers.weather.priority=300", # to override the longer rule for wordpress
]
check {
type = "http"
path = "/health"
interval = "10s"
timeout = "2s"
}
}
service {
name = "osweather"
port = "osweather"
}
}
}