Files
alo-cluster/services/weewx.hcl
2024-01-16 16:13:01 +00:00

67 lines
1.2 KiB
HCL

job "weewx" {
datacenters = ["alo"]
meta {
uuid = uuidv4()
}
group "weather" {
network {
port "http" {
}
}
task "backend" {
driver = "docker"
config {
image = "gitea.v.paler.net/ppetru/weewx:latest"
volumes = [
"/data/compute/appdata/weewx/etc:/etc/weewx",
"/data/compute/appdata/weewx/html:/var/www/html",
]
}
resources {
# needed for running weectl report run inside the container
#memory = 1024
}
}
task "frontend" {
driver = "docker"
config {
image = "pierrezemb/gostatic"
ports = [ "http" ]
args = [
"-port=${NOMAD_PORT_http}",
"-enable-health",
]
volumes = [ "/data/compute/appdata/weewx/html:/srv/http" ]
}
}
service {
name = "weather"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.weather.entryPoints=websecure",
"traefik.http.routers.weather.rule=Host(`weewx.v.paler.net`) || (Host(`alo.land`) && PathPrefix(`/weather/`))",
]
check {
type = "http"
path = "/health"
interval = "10s"
timeout = "2s"
}
}
}
}