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:
+17
-5
@@ -1,15 +1,27 @@
|
||||
# Lightweight static host for the homelab dashboard.
|
||||
# Builds a small nginx image that serves index.html + assets.
|
||||
# Dashboard: nginx static host + calendar/data updater + API proxy.
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
# Copy the site (static files only — no build step needed)
|
||||
# Install Node.js and cron for the data updater.
|
||||
RUN apk add --no-cache nodejs dcron
|
||||
|
||||
# Copy site assets.
|
||||
COPY index.html style.css script.js /usr/share/nginx/html/
|
||||
COPY icons /usr/share/nginx/html/icons
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# nginx listens on port 80
|
||||
# Backend scripts (node_modules included so the build works offline).
|
||||
COPY api /opt/dashboard
|
||||
|
||||
# Cron refreshes the data feed every 15 minutes.
|
||||
RUN echo '*/15 * * * * cd /opt/dashboard && node update-data.js' > /etc/crontabs/root
|
||||
|
||||
# Entrypoint: run updater once, start API proxy + cron, then nginx.
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget -q --spider http://127.0.0.1:80/ || exit 1
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user