Files
stpweb/quartz/Dockerfile
adamfandClaude Opus 5.5 7ce86f08ec Replace Quartz with a read-only SilverBullet for public /notes/
/notes/ is now served by silverbullet-public: the same SilverBullet 2.11.0
image as the /sb/ editor, run with SB_READ_ONLY over a read-only mount of
the vault. Quartz is retired (quartz/ kept with a STATUS header).

Keeping private/ off the public site needs nginx, not just SilverBullet:
SB_SPACE_IGNORE only filters the file listing. Verified with curl that
2.11.0 still serves ignored paths via /.fs/<path>, via server-rendered page
URLs, and exposes the vault's .git through /.fs/.git/. nginx now 404s any
private/ or templates/ segment at any depth and any nested dot-folder under
/notes/. SB_REVISIONS=disabled stops /.revisions serving git history, and
nginx blocks it as a second layer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-30 20:37:10 +01:00

50 lines
2.1 KiB
Docker

# =============================================================================
# Quartz image — builds the Obsidian notes site.
#
# STATUS: RETIRED (not live). /notes/ is now served by the read-only
# silverbullet-public service; this directory is no longer referenced by
# docker-compose.yml or nginx. Kept for reference / rollback: restoring it means
# re-adding the service, the QUARTZ_* vars to nginx/entrypoint.sh's allow-list,
# and pointing /notes/ back at it (with the prefix-strip rewrite Quartz needs).
#
# HOW THE SOURCE IS OBTAINED: Quartz is not an npm package you depend on, it is
# an application you clone and configure. So the image `git clone`s the
# upstream repo at build time, which is why `git` is installed. --depth 1
# --branch pins to an exact tag (QUARTZ_VERSION, overridable as a build ARG)
# and fetches no history — a shallow clone is much faster on a Pi and the
# history is of no use here.
#
# Because this clone happens at build time, upstream Quartz is only updated
# when the image is rebuilt with a bumped QUARTZ_VERSION. The tag pin is the
# thing stopping an upstream change from breaking the notes site on a routine
# redeploy.
#
# gettext-base supplies `envsubst` for rendering quartz.config.ts from its
# template at container start (see quartz/entrypoint.sh).
#
# quartz.config.ts.template and quartz.layout.ts are copied in AFTER the clone
# so they land on top of the upstream defaults — layout is used as-is, config
# is templated at runtime because it needs DOMAIN.
#
# node:22-slim is multi-arch, so this builds unchanged on the Pi.
# =============================================================================
FROM node:22-slim
RUN apt-get update \
&& apt-get install --yes git gettext-base \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /quartz
ARG QUARTZ_VERSION=v4.4.0
RUN git clone --depth 1 --branch ${QUARTZ_VERSION} \
https://github.com/jackyzha0/quartz.git . \
&& npm ci
COPY quartz.config.ts.template /quartz/quartz.config.ts.template
COPY quartz.layout.ts /quartz/quartz.layout.ts
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]