Nomad stuff
Some checks are pending
Build, Push, and Deploy to Nomad / docker-nomad (push) Waiting to run

This commit is contained in:
Henrik Jess Nielsen
2025-10-05 15:48:30 +02:00
parent 57739f565a
commit 6e97805eea
2 changed files with 104 additions and 63 deletions

View File

@@ -0,0 +1,104 @@
job "lifefaq" {
region = "global"
datacenters = ["dc1"]
type = "service"
meta {
uuid = uuidv4()
deployed_at = "[[ timeNowUTC ]]"
}
update {
max_parallel = 1
canary = 2
auto_revert = false
min_healthy_time = "10s"
healthy_deadline = "10m"
auto_promote = true
progress_deadline = "15m"
}
group "lifefaq-group" {
count = 2
network {
port "http" {
}
}
constraint {
attribute = "${node.unique.name}"
value = "autobox.i80.dk"
}
reschedule {
attempts = 5
interval = "10m"
delay = "30s"
delay_function = "exponential"
max_delay = "120s"
unlimited = false
}
service {
provider = "consul"
name = "lifefaq"
port = "http"
tags = [
"traefik.enable=true",
"traefik.http.routers.lifefaq.rule=Host(`lifefaq.i80.dk`)",
"traefik.http.routers.lifefaq.tls=true"
]
check {
address_mode = "host"
name = "http_health_check"
type = "http"
path = "/health"
interval = "10s"
timeout = "5s"
}
}
task "lifefaq-task" {
driver = "docker"
config {
image = "registry.i80.dk/gitea/lifefaq:latest"
ports = ["http"]
force_pull = true
auth {
username = "robot$gitserver"
password = "${HARBOR_ROBOT_TOKEN}"
}
}
restart {
attempts = 10
interval = "10m"
delay = "10s"
mode = "fail"
}
env {
APP_ENV = "production"
PORT = "${NOMAD_PORT_http}"
HOST = "0.0.0.0"
}
template {
data = <<EOH
HARBOR_ROBOT_TOKEN="{{ key "harbor/robot/token" }}"
EOH
destination = "secrets/registry.env"
env = true
}
resources {
cpu = 300
memory = 256
}
}
}
}