This commit is contained in:
2025-12-27 15:09:05 -05:00
parent c69943692b
commit 9d043bd142

View File

@@ -3,51 +3,100 @@ job "ai-frontend" {
region = "home" region = "home"
type = "service" type = "service"
# --- OpenWebUI ---
group "openwebui" { group "openwebui" {
count = 1 count = 1
# PIN TO HP1 (Change "hp-mini-1" to your actual node name if different)
constraint {
attribute = "${attr.unique.hostname}"
value = "hp-mini-1"
}
network { network {
port "http" { to = 8080 } port "http" { to = 8080 }
} }
service { service {
name = "openwebui" name = "openwebui"
port = "http" port = "http"
tags = ["traefik.enable=true"] tags = ["traefik.enable=true"]
}
task "server" { check {
driver = "podman" type = "http"
env { path = "/health"
OLLAMA_BASE_URL = "http://ollama.service.consul:11434" interval = "20s"
} timeout = "2s"
config {
image = "ghcr.io/open-webui/open-webui:main"
ports = ["http"]
volumes = ["/opt/homelab/openwebui:/app/backend/data"]
}
resources { cpu = 1000; memory = 1024 }
} }
} }
task "server" {
driver = "podman"
env {
# Magic: Uses Consul to find the P52 automatically
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"
]
}
resources {
cpu = 1000
memory = 1024
}
}
}
# --- LobeChat ---
group "lobechat" { group "lobechat" {
count = 1 count = 1
# PIN TO HP1
constraint {
attribute = "${attr.unique.hostname}"
value = "hp-mini-1"
}
network { network {
port "http" { to = 3210 } port "http" { to = 3210 }
} }
service { service {
name = "lobechat" name = "lobechat"
port = "http" port = "http"
tags = ["traefik.enable=true"] tags = ["traefik.enable=true"]
check {
type = "http"
path = "/api/health"
interval = "20s"
timeout = "2s"
} }
}
task "server" { task "server" {
driver = "podman" driver = "podman"
env { env {
OLLAMA_PROXY_URL = "http://ollama.service.consul:11434" OLLAMA_PROXY_URL = "http://ollama.service.consul:11434"
ACCESS_CODE = "securepassword123" ACCESS_CODE = "securepassword123"
} }
config { config {
image = "docker.io/lobehub/lobe-chat" image = "docker.io/lobehub/lobe-chat"
ports = ["http"] ports = ["http"]
} }
resources { cpu = 500; memory = 512 }
resources {
cpu = 500
memory = 512
}
} }
} }
} }