Skip to content

Instantly share code, notes, and snippets.

@langerma
Created September 26, 2020 12:52
Show Gist options
  • Save langerma/f5c6d484da172544d52b8d26bde70274 to your computer and use it in GitHub Desktop.
Save langerma/f5c6d484da172544d52b8d26bde70274 to your computer and use it in GitHub Desktop.
job "homeassistant" {
datacenters = ["morsegasse"]
type = "service"
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "6m"
progress_deadline = "10m"
auto_revert = false
canary = 0
}
migrate {
max_parallel = 1
health_check = "checks"
min_healthy_time = "15s"
healthy_deadline = "10m"
}
group "homeassistant" {
count = 1
restart {
attempts = 2
interval = "30m"
delay = "15s"
mode = "fail"
}
task "homeassistant_core" {
driver = "docker"
config {
hostname = "hostname"
force_pull = true
image = "homeassistant/home-assistant:stable"
network_mode = "host"
privileged = true
volumes = [
"/nfs/home_assistant/config:/config",
"/etc/localtime:/etc/localtime:ro"
]
port_map {
homeassistant_core = 8123
}
}
resources {
cpu = 800 # 500 MHz
memory = 512 # 512 MB
network {
mbits = 300
port "homeassistant_core" { static = 8123 }
}
}
service {
name = "homeassistant"
tags = ["homeassistant", "homeautomation", "traefik.enable=true"]
port = "homeassistant_core"
check {
name = "alive"
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment