Add backend data aggregator and API proxy services
- update-data.js: cron job that aggregates Google Calendar ICS feeds (today + upcoming, node-ical), Netbird reachability, Gitea/GitLab commit stats and Open WebUI models into data.json - server.js: small Node proxy behind nginx exposing /api/chat (Open WebUI completions), /api/gpu-stats and /api/ollama - gitlab-relay.js: prepared HTTP relay for GitLab over a Netbird VPN (not wired up yet; the setup key was rejected by vpn.ixsol.at) - docker-entrypoint.sh: starts updater in the background, API proxy, cron (15 min refresh) and nginx without blocking startup - nginx: proxy locations + no-cache for data.json - compose: TZ, token env wiring from .env, gpu-stats service (python + rocm-smi with device passthrough) - dockerignore: keep .env out of the build context
This commit is contained in:
@@ -8,6 +8,46 @@ services:
|
||||
ports:
|
||||
- "8888:80"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# Timezone used for the "Today" calendar widget.
|
||||
- TZ=Europe/Vienna
|
||||
# Secrets live in .env (gitignored) — compose reads it automatically.
|
||||
- OPENWEBUI_TOKEN=${OPENWEBUI_TOKEN:-}
|
||||
# Optional API tokens for live stats / git integration.
|
||||
# Uncomment and fill in to enable private git stats.
|
||||
# - GITEA_TOKEN=
|
||||
# - GITLAB_TOKEN=
|
||||
# - NETBIRD_TOKEN=
|
||||
# GPU stats upstream; defaults to the gpu-stats service below.
|
||||
# To run gpu_stats.py on the host instead, use:
|
||||
# http://host.docker.internal:9101/stats
|
||||
# (and add: extra_hosts: ["host.docker.internal:host-gateway"])
|
||||
# - GPU_STATS_URL=http://gpu-stats:9101/stats
|
||||
# Ollama instance for the loaded-model stats in the GPU widget.
|
||||
# - OLLAMA_URL=http://100.103.83.12:11435
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: "1m"
|
||||
max-file: "2"
|
||||
|
||||
# AMD GPU stats via rocm-smi (gpu_stats.py).
|
||||
# Needs the host's ROCm install + GPU device nodes passed through.
|
||||
gpu-stats:
|
||||
image: python:3.12-slim
|
||||
container_name: homelab-gpu-stats
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# rocm-smi can't read the device name without libdrm; set it explicitly.
|
||||
- GPU_NAME=AMD Radeon AI PRO R9700
|
||||
# - ROCM_SMI_PATH=/opt/rocm/bin/rocm-smi
|
||||
volumes:
|
||||
- ./gpu_stats.py:/app/gpu_stats.py:ro
|
||||
- /opt/rocm:/opt/rocm:ro
|
||||
devices:
|
||||
- /dev/kfd
|
||||
- /dev/dri
|
||||
command: python3 /app/gpu_stats.py
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
|
||||
Reference in New Issue
Block a user