orchestration-tests/nomad/blocky/blocky.nomad

68 lines
1.1 KiB
HCL

variable "config_data" {
type = string
description = "Plain text config file for blocky"
}
job "blocky" {
datacenters = ["dc1"]
type = "service"
group "blocky" {
count = 1
network {
mode = "bridge"
port "dns" {
static = "53"
}
port "web" {
to = "4000"
}
}
service {
name = "blocky-dns"
port = "dns"
}
service {
name = "blocky-api"
port = "web"
tags = [
"traefik.enable=true",
"traefik.consulcatalog.connect=false",
"traefik.http.routers.blocky.entrypoints=web,websecure",
"traefik.http.routers.blocky.tls=true",
]
}
task "main" {
driver = "docker"
config {
image = "ghcr.io/0xerr0r/blocky"
ports = ["dns", "web"]
mount {
type = "bind"
target = "/app/config.yml"
source = "app/config.yml"
}
}
resources {
cpu = 50
memory = 100
}
template {
data = var.config_data
destination = "app/config.yml"
}
}
}
}