Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Created March 28, 2021 01:06
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nateberkopec/760369fc3ee5d777ae0da247355aded6 to your computer and use it in GitHub Desktop.
Save nateberkopec/760369fc3ee5d777ae0da247355aded6 to your computer and use it in GitHub Desktop.
Pihole and homekit HCLs for Nomad
job "homebridge" {
datacenters = ["dc1"]
group "server" {
network {
port "http" {
to = 8581
}
}
task "container" {
# The "driver" parameter specifies the task driver that should be used to
# run the task.
driver = "docker"
env {
TZ = "America/Denver"
}
config {
image = "oznu/homebridge:latest"
ports = ["http"]
network_mode = "host"
volumes = ["/home/pi/nomad/data/homebridge:/homebridge"]
}
resources {
cpu = 100
memory = 256
}
}
}
}
job "pihole" {
datacenters = ["dc1"]
group "pi" {
network {
port "dns" {
static = "53"
to = "53"
}
port "http" {
to = "80"
}
}
task "server" {
driver = "docker"
env {
TZ = "America/Denver"
WEBPASSWORD = "secret"
}
config {
image = "pihole/pihole:latest"
ports = ["http", "dns"]
mounts = [
{
type = "bind"
target = "/etc/pihole"
source = "/home/pi/nomad/data/pihole/pihole"
readonly = false
},
{
type = "bind"
target = "/etc/dnsmasq.d"
source = "/home/pi/nomad/data/pihole/dnsmasq.d"
readonly = false
},
]
dns_servers = [
"127.0.0.1",
"8.8.8.8",
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment