- Refactor conversion logic into reusable convert.js module - Add HTTP server with upload UI, HTML/PDF download, and live preview - Dockerfile with Chromium for server-side PDF rendering - Local mermaid.min.js injection for offline diagram rendering Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
575 B
Docker
25 lines
575 B
Docker
FROM node:22-slim
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
chromium \
|
|
fonts-freefont-ttf \
|
|
fonts-noto-cjk \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY convert.js server.js md2html.js mermaid.min.js ./
|
|
|
|
ENV CHROME_PATH=/usr/bin/chromium
|
|
ENV PORT=3000
|
|
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
|
CMD node -e "require('http').get('http://localhost:3000/health', r => process.exit(r.statusCode === 200 ? 0 : 1))"
|
|
|
|
CMD ["node", "server.js"]
|