Add web service, PDF export, and Docker support
- 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>
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,6 +1,5 @@
|
||||
FROM node:22-slim
|
||||
|
||||
# Install Chrome dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
chromium \
|
||||
fonts-freefont-ttf \
|
||||
@@ -12,8 +11,14 @@ WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY md2html.js mermaid.min.js ./
|
||||
COPY convert.js server.js md2html.js mermaid.min.js ./
|
||||
|
||||
ENV CHROME_PATH=/usr/bin/chromium
|
||||
ENV PORT=3000
|
||||
|
||||
ENTRYPOINT ["node", "md2html.js"]
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user