Files
espresso_frame/server/Dockerfile
T
tfaour 644fdefa66
Build and push server image / build-and-push (push) Failing after 1m10s
Add whiteboard frame mode (Nextcloud Whiteboard / Excalidraw over WebDAV)
New third mode alongside photos/calendar: fetches a .whiteboard file
over plain WebDAV (Basic auth -- generic, not Nextcloud-specific) and
renders it via a small Node.js sidecar using Excalidraw's own real
export code (@excalidraw/utils + @resvg/resvg-js, no headless browser),
since a .whiteboard file turns out to be Excalidraw scene JSON, not an
image. The sidecar runs as a second process inside this same container
(Dockerfile installs Node, start.sh backgrounds it before exec'ing
uvicorn) rather than a separate docker-compose service -- lightweight,
stateless, reachable only at 127.0.0.1 from the Python process, nothing
worth independently scaling.

The rendered PNG is treated exactly like a photo from there on --
composed/quantized through the existing image_pipeline (letterboxed,
never cropped) rather than a second parallel rendering pipeline.

WebDAV credentials support the common "it's actually the same Nextcloud
account as my CalDAV" case (an explicit opt-in checkbox, not silently
inferred) while still working with any WebDAV server generically.
Frame-level source (URL + owning account) follows the same owner-
controls-their-own-data permission split as calendar sources and the
week view's task list: only the account owner can point a frame at it,
anyone linked can clear it.

Honest limitation: this environment has no Node.js/npm, so
render-service/ is written carefully against each library's documented
API (verified via the npm registry, including transitive dependency
licenses after the CalDAV/AGPL surprise earlier this session) but has
never actually been executed. First real docker build is the first
true test -- see render-service/README.md.
2026-07-23 17:02:08 -04:00

37 lines
1.4 KiB
Docker

FROM python:3.12-slim
WORKDIR /app
# tzdata: python:3.12-slim doesn't include it by default, so the zoneinfo
# database backing the web UI's "Timezone" setting (used by "Quiet hours")
# would have no named zones to resolve without this -- ZoneInfo() would
# raise for anything other than "UTC".
#
# Node.js + fonts: whiteboard frame mode's render-service/ (own README
# there) runs as a second process in this same container rather than a
# separate compose service -- it's a lightweight, stateless, localhost-
# only sidecar with nothing worth independently scaling or restarting.
# NodeSource's setup script is used instead of Debian bookworm's own
# apt Node package, which is both older than jsdom's minimum (20.19+)
# and inconsistently available. fonts-dejavu-core gives the sidecar's
# SVG rasterizer something to render whiteboard text with.
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata curl ca-certificates gnupg fontconfig fonts-dejavu-core \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY render-service ./render-service
RUN cd render-service && npm install --omit=dev
COPY app ./app
COPY start.sh .
RUN chmod +x start.sh
EXPOSE 8420
CMD ["./start.sh"]