docfast/Dockerfile
OpenClaw e51e65524a
Some checks failed
Deploy to Production / Deploy to Server (push) Has been cancelled
refactor: extract shared partials from HTML pages (nav, footer, styles, modals)
- Created build-time templating system using existing build-html.cjs
- Extracted index.html into source template with partials:
  _styles_index.html, _nav_index.html, _modals.html
- All 4 templated pages (index, impressum, privacy, terms) use partials
- docs.html excluded (Swagger UI, completely different structure)
- Added HTML build step to Dockerfile
- Built output is byte-identical to original files
2026-02-16 18:52:31 +00:00

34 lines
915 B
Docker

FROM node:22-bookworm-slim
# Install Chromium and dependencies as root
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium fonts-liberation \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN groupadd --gid 1001 docfast \
&& useradd --uid 1001 --gid docfast --shell /bin/bash --create-home docfast
# Set environment variables
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /app
COPY package*.json ./
RUN npm install --omit=dev
COPY dist/ dist/
COPY scripts/ scripts/
COPY public/ public/
RUN node scripts/build-html.cjs
RUN rm -f public/swagger-ui && ln -s /app/node_modules/swagger-ui-dist public/swagger-ui
# Create data directory and set ownership to docfast user
RUN mkdir -p /app/data && chown -R docfast:docfast /app
# Switch to non-root user
USER docfast
ENV PORT=3100
EXPOSE 3100
CMD ["node", "dist/index.js"]