Files
00c89c1b48 feat(printer): badge print queue, Pi worker, captive-portal setup, admin printing view
- migration 20261018170000: pgmq badge_print/badge_print_dlq, print_stations,
  token-gated printer RPCs (claim/complete/fail/heartbeat), admin RPCs,
  welcome_checkin enqueue; badge_print_tests.sql (101 assertions)
- apps/printer: Python worker (Playwright render -> brother_ql via pyusb),
  comitup captive-portal (Wi-Fi + HTTPS endpoint + anon key + token),
  arm64 image build + idempotent Pi setup/install scripts, 77 pytest
- apps/admin: Printing view, station management/DLQ, global printer status
  pill, Print button on Registrations, standalone print renderer entry
  (print.html -> dist-print) with bundled fonts
- docs: printing.md + architecture/schema/rpcs/tests/admin-app updates,
  apps/printer/AGENT.md operating manual
- e2e: printing.spec.ts

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
2026-10-18 22:25:38 +02:00

37 lines
1.3 KiB
Docker

# Convivo badge-printer worker.
# Build context = REPO ROOT:
# docker buildx build --platform linux/arm64 -f apps/printer/Dockerfile -t convivo-printer:latest .
# --- badge print renderer (built on the native build platform for speed) ------
FROM --platform=$BUILDPLATFORM node:20-bookworm-slim AS renderer
WORKDIR /build
COPY apps/admin/package.json apps/admin/package-lock.json ./
RUN npm ci
COPY apps/admin/ ./
RUN npx vite build --config vite.print.config.ts
# --- runtime: Playwright Chromium + brother_ql + worker ------------------------
FROM mcr.microsoft.com/playwright/python:v1.55.0-noble
ARG APP_VERSION=dev
RUN apt-get update \
&& apt-get install -y --no-install-recommends libusb-1.0-0 fonts-dejavu-core \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY apps/printer/requirements.txt ./requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY apps/printer/worker/ /app/worker/
COPY --from=renderer /build/dist-print /app/renderer/
ENV PYTHONUNBUFFERED=1 \
APP_VERSION=${APP_VERSION}
# Root on purpose: raw USB access for the Brother printer (no privileged mode).
# The image's Chromium runs with --no-sandbox (set in render.py).
HEALTHCHECK --interval=30s --timeout=5s --start-period=120s \
CMD find /tmp/heartbeat-ok -mmin -1 | grep -q . || exit 1
CMD ["python", "-m", "worker"]