113 lines
1.7 KiB
HCL
113 lines
1.7 KiB
HCL
job "dns" {
|
|
region = "global"
|
|
datacenters = ["samfelag"]
|
|
type = "service"
|
|
|
|
group "dns" {
|
|
count = 1
|
|
|
|
restart {
|
|
attempts = 10
|
|
delay = "15s"
|
|
}
|
|
|
|
# VOLUMES
|
|
## pihole
|
|
|
|
volume "pihole" {
|
|
type = "host"
|
|
read_only = false
|
|
source = "dns-pihole"
|
|
}
|
|
|
|
volume "dnsmasq" {
|
|
type = "host"
|
|
read_only = false
|
|
source = "dns-dnsmasq"
|
|
}
|
|
|
|
## unbound
|
|
|
|
volume "unbound" {
|
|
type = "host"
|
|
read_only = false
|
|
source = "dns-unbound"
|
|
}
|
|
|
|
# NETWORK
|
|
|
|
network {
|
|
port "dns" {
|
|
static = 53
|
|
}
|
|
port "http" {
|
|
to = 80
|
|
}
|
|
port "unbound" {
|
|
static = 5533
|
|
}
|
|
}
|
|
|
|
# TASKS
|
|
|
|
task "pihole" {
|
|
driver = "docker"
|
|
|
|
volume_mount {
|
|
volume = "pihole"
|
|
destination = "/etc/pihole"
|
|
read_only = false
|
|
}
|
|
|
|
volume_mount {
|
|
volume = "dnsmasq"
|
|
destination = "/etc/dnsmasq.d"
|
|
read_only = false
|
|
}
|
|
|
|
env {
|
|
TZ = "Europe/Amsterdam"
|
|
WEBPASSWORD = "elbonfeix"
|
|
ServerIP = "100.80.195.56"
|
|
}
|
|
|
|
config {
|
|
image = "pihole/pihole:v5.7"
|
|
ports = ["dns", "http"]
|
|
}
|
|
|
|
resources {
|
|
cpu = 100
|
|
memory = 32
|
|
}
|
|
|
|
service {
|
|
name = "pihole-gui"
|
|
port = "http"
|
|
}
|
|
}
|
|
|
|
task "unbound" {
|
|
driver = "docker"
|
|
|
|
volume_mount {
|
|
volume = "unbound"
|
|
destination = "/opt/unbound/etc/unbound/"
|
|
read_only = false
|
|
}
|
|
|
|
config {
|
|
image = "mvance/unbound:latest"
|
|
ports = ["unbound"]
|
|
}
|
|
|
|
resources {
|
|
cpu = 50
|
|
memory = 32
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|