Files
nomad-nummer5/_sys/traeffik.hcl
2023-09-19 19:49:36 +02:00

75 lines
1.2 KiB
HCL

job "traefik" {
region = "global"
datacenters = ["nummer5"]
type = "service"
group "traefik" {
count = 1
network {
port "http" {
static = 80
}
port "api" {
static = 81
}
}
service {
name = "traefik"
check {
name = "alive"
type = "tcp"
port = "http"
interval = "10s"
timeout = "2s"
}
}
task "traefik" {
driver = "podman"
config {
image = "docker.io/library/traefik:latest"
network_mode = "host"
volumes = [
"local/traefik.toml:/etc/traefik/traefik.toml",
]
}
template {
data = <<EOF
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.traefik]
address = ":81"
[api]
dashboard = true
insecure = true
# Enable Consul Catalog configuration backend.
[providers.consulCatalog]
prefix = "traefik"
exposedByDefault = false
[providers.consulCatalog.endpoint]
address = "127.0.0.1:8500"
scheme = "http"
EOF
destination = "local/traefik.toml"
}
resources {
cpu = 100
memory = 128
}
}
}
}