variable "image_tag" { description = "Docker image tag" type = string default = "core" } job "check" { region = "global" datacenters = ["dc1"] type = "service" meta { uuid = uuidv4() deployed_at = "[[ timeNowUTC ]]" } update { stagger = "30s" max_parallel = 1 auto_revert = true progress_deadline = "20m" } group "check-group" { count = 1 constraint { attribute = "${node.unique.name}" value = "int" } update { canary = 1 auto_promote = true min_healthy_time = "30s" healthy_deadline = "15m" progress_deadline = "20m" auto_revert = true } network { port "http" {} } reschedule { attempts = 5 interval = "10m" delay = "30s" delay_function = "exponential" max_delay = "120s" unlimited = false } service { provider = "consul" name = "check" port = "http" tags = [ "traefik.enable=true", "traefik.http.routers.check.rule=Host(`check.i80.dk`)", "traefik.http.routers.check.tls=true", ] check { name = "http_health" type = "http" port = "http" path = "/health" interval = "15s" timeout = "5s" } } task "check-task" { driver = "docker" config { image = "ghcr.io/kreuzberg-dev/kreuzberg:${var.image_tag}" ports = ["http"] force_pull = true args = [ "serve", "--host", "0.0.0.0", "--port", "${NOMAD_PORT_http}", ] } restart { attempts = 5 interval = "10m" delay = "20s" mode = "fail" } env { RUST_LOG = "info" KREUZBERG_CACHE_DIR = "/app/.kreuzberg" HF_HOME = "/app/.kreuzberg/huggingface" LD_LIBRARY_PATH = "/usr/local/lib:/usr/lib:/lib" } resources { cpu = 500 memory = 1024 memory_max = 4096 } } } }