Files
dashboard/Dockerfile
T
fegger dfe246b7ca Add Outlook unread-mail widget with device-code login
- outlook-auth.js: one-time device-code flow against Microsoft login;
  stores the refresh token in the outlook-tokens compose volume
- update-outlook.js: per-minute cron fetching the unread count and the
  latest unread messages via Microsoft Graph; caches access tokens and
  persists rotated refresh tokens
- Widget is hidden until the mailbox is actually authorized, so it
  stays out of sight while (admin) consent is pending
- New external card for Outlook (Office 365) with the official icon
- compose: pass OUTLOOK_CLIENT_ID/OUTLOOK_TENANT/GITEA_TOKEN from .env
- README: Entra ID app registration steps and the tenant-ID hint for
  directories not resolvable via the organizations endpoint
2026-09-04 17:38:17 +02:00

28 lines
1.0 KiB
Docker

# Dashboard: nginx static host + calendar/data updater + API proxy.
FROM nginx:1.27-alpine
# 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
# Backend scripts (node_modules included so the build works offline).
COPY api /opt/dashboard
# Cron: data feed every 15 min, health checks + Outlook unread every minute.
RUN printf '*/15 * * * * cd /opt/dashboard && node update-data.js\n* * * * * cd /opt/dashboard && node update-health.js\n* * * * * cd /opt/dashboard && node update-outlook.js\n' > /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
ENTRYPOINT ["/docker-entrypoint.sh"]