- Replace the static nginx site with a small Node server: serves public/, stores plays on a /data volume and exposes a JSON API. Writes need a shared UPLOAD_PASSWORD; unpublished plays are hidden without it. - Page photos (shrunk to <=1.15 MP JPEG in the browser) are transcribed one request per page by a Claude vision model (claude-haiku-5-5 by default, CLAUDE_MODEL to change) into the play markup, then stitched together: speaker spellings unified, gaps in page numbers marked as missing pages, failed pages flagged. DAILY_PAGE_LIMIT caps spend. - New pages: library (play menu), add (upload + progress), editor (text next to the photos, checks for [?] readings and one-off names, publish, delete). The reader loads plays from the API and remembers the chosen role per play; old /?postava= links still work. - PDF export: text now flows across original pages and prints at the on-screen size, so A4 sheets are full instead of half empty; page numbers in the footer. - docker-compose.yml + .env.example for one-click deploys; the 1931 play moves to seed/ and is copied into an empty volume on first start. - Tests: parser leniency, transcription assembly, API end to end with a stubbed Claude client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HA82gVRDXpoukzgMFumoJt
23 lines
654 B
Docker
23 lines
654 B
Docker
# Theater reader: Node server for the app, the plays API and transcription.
|
|
FROM docker.io/library/node:22-alpine
|
|
|
|
ENV NODE_ENV=production PORT=8080 DATA_DIR=/data
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev && npm cache clean --force
|
|
|
|
COPY server/ server/
|
|
COPY public/ public/
|
|
COPY seed/ seed/
|
|
|
|
# Plays and uploaded photos live on the /data volume, owned by the unprivileged user.
|
|
RUN mkdir -p /data && chown node:node /data
|
|
USER node
|
|
VOLUME /data
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
|
|
CMD wget -q -O /dev/null http://127.0.0.1:8080/healthz || exit 1
|
|
|
|
CMD ["node", "server/main.mjs"]
|