homelab/nomad-job/homeassistant.nomad

74 lines
1.8 KiB
Plaintext
Raw Normal View History

2022-05-07 12:46:29 +00:00
job "homeassistant" {
datacenters = ["homelab"]
2022-12-10 16:10:32 +00:00
priority = 90
2022-10-29 08:40:01 +00:00
type = "service"
2022-05-07 12:46:29 +00:00
meta {
2022-05-23 19:44:34 +00:00
forcedeploy = "0"
2022-05-07 12:46:29 +00:00
}
constraint {
2022-11-13 16:01:03 +00:00
attribute = "${attr.cpu.arch}"
value = "amd64"
2022-05-07 12:46:29 +00:00
}
2022-10-29 08:40:01 +00:00
group "homeassistant" {
2022-05-07 12:46:29 +00:00
network {
mode = "host"
port "http" {
2022-10-29 08:40:01 +00:00
to = 8123
2022-05-07 12:46:29 +00:00
static = 8123
}
2022-10-29 08:40:01 +00:00
port "coap" {
to = 5683
2022-05-07 12:46:29 +00:00
static = 5683
}
}
task "hass" {
driver = "docker"
service {
name = "${NOMAD_TASK_NAME}"
port = "http"
tags = [
2022-10-29 08:40:01 +00:00
"homer.enable=true",
"homer.name=Hass",
"homer.service=Application",
"homer.subtitle=Home Assistant",
"homer.logo=https://raw.githubusercontent.com/home-assistant/assets/master/logo/logo-small.svg",
"homer.target=_blank",
"homer.url=https://${NOMAD_TASK_NAME}.ducamps.win",
"traefik.enable=true",
"traefik.http.routers.${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_TASK_NAME}.ducamps.win`)",
"traefik.http.routers.${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_TASK_NAME}.ducamps.win",
"traefik.http.routers.${NOMAD_TASK_NAME}.tls.certresolver=myresolver",
2023-10-07 16:40:40 +00:00
"traefik.http.routers.${NOMAD_TASK_NAME}.entrypoints=web,websecure",
2022-05-07 12:46:29 +00:00
]
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
config {
2022-10-29 08:40:01 +00:00
image = "homeassistant/home-assistant:stable"
ports = ["http", "coap"]
privileged = "true"
2022-05-07 12:46:29 +00:00
network_mode = "host"
volumes = [
"/mnt/diskstation/nomad/hass:/config",
]
}
env {
TZ = "Europe/Paris"
}
resources {
cpu = 800 # 500 MHz
memory = 512 # 512 MB
2022-10-29 08:40:01 +00:00
}
2022-05-07 12:46:29 +00:00
}
}
2022-10-29 08:40:01 +00:00
}