Corrected the LobeChat service health check path from `/api/health` to `/` as the root endpoint is the correct health indicator. This resolves an issue where the service was not being properly marked as healthy by Nomad. Additionally, this commit refactors comments across both `ai-frontend` (OpenWebUI) and `lobechat` jobs within the `ai-frontend.nomad` file. Redundant or outdated comments regarding DNS "reverts," version pinning, and security notes have been removed or simplified to improve readability and reflect the stable state of the configurations. The Consul DNS configuration is now consistently marked as a "DNS Fix" rather than a temporary solution.
114 lines
2.2 KiB
HCL
114 lines
2.2 KiB
HCL
job "ai-frontend" {
|
|
datacenters = ["Homelab-PTECH-DC"]
|
|
region = "home"
|
|
type = "service"
|
|
|
|
# --- OpenWebUI ---
|
|
group "openwebui" {
|
|
count = 1
|
|
|
|
constraint {
|
|
attribute = "${attr.unique.hostname}"
|
|
value = "hp1-home"
|
|
}
|
|
|
|
network {
|
|
port "http" {
|
|
static = 8080
|
|
to = 8080
|
|
}
|
|
}
|
|
|
|
service {
|
|
name = "openwebui"
|
|
port = "http"
|
|
tags = ["traefik.enable=true"]
|
|
check {
|
|
type = "http"
|
|
path = "/health" # OpenWebUI actually HAS this endpoint
|
|
interval = "20s"
|
|
timeout = "2s"
|
|
}
|
|
}
|
|
|
|
task "server" {
|
|
driver = "podman"
|
|
|
|
env {
|
|
OLLAMA_BASE_URL = "http://ollama.service.consul:11434"
|
|
}
|
|
|
|
config {
|
|
image = "ghcr.io/open-webui/open-webui:main"
|
|
ports = ["http"]
|
|
volumes = [
|
|
"/mnt/local-ssd/nomad/stacks/ai/ai-frontend/openwebui:/app/backend/data"
|
|
]
|
|
|
|
# DNS Fix
|
|
dns_servers = ["192.168.1.133"]
|
|
dns_search = ["service.consul"]
|
|
}
|
|
|
|
resources {
|
|
cpu = 1000
|
|
memory = 1024
|
|
}
|
|
}
|
|
}
|
|
|
|
# --- LobeChat ---
|
|
group "lobechat" {
|
|
count = 1
|
|
|
|
constraint {
|
|
attribute = "${attr.unique.hostname}"
|
|
value = "hp1-home"
|
|
}
|
|
|
|
network {
|
|
port "http" {
|
|
static = 3210
|
|
to = 3210
|
|
}
|
|
}
|
|
|
|
service {
|
|
name = "lobechat"
|
|
port = "http"
|
|
tags = ["traefik.enable=true"]
|
|
|
|
# --- THE FIX ---
|
|
# Changed from /api/health to / (Root)
|
|
check {
|
|
type = "http"
|
|
path = "/"
|
|
interval = "20s"
|
|
timeout = "2s"
|
|
}
|
|
}
|
|
|
|
task "server" {
|
|
driver = "podman"
|
|
|
|
env {
|
|
OLLAMA_PROXY_URL = "http://ollama.service.consul:11434"
|
|
ACCESS_CODE = "securepassword123"
|
|
}
|
|
|
|
config {
|
|
image = "docker.io/lobehub/lobe-chat:v1.143.0"
|
|
ports = ["http"]
|
|
|
|
# DNS Fix
|
|
dns_servers = ["192.168.1.133"]
|
|
dns_search = ["service.consul"]
|
|
}
|
|
|
|
resources {
|
|
cpu = 500
|
|
memory = 1024
|
|
}
|
|
}
|
|
}
|
|
} |