docfast/Dockerfile
OpenClaw Deployer e611609580
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 10m59s
Promote to Production / Deploy to Production (push) Successful in 1m15s
fix: compile TypeScript in Docker build — dist/ was never built in CI, connection resilience code was missing from images
2026-02-18 16:19:59 +00:00

38 lines
1,014 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
# Build stage - compile TypeScript
WORKDIR /app
COPY package*.json tsconfig.json ./
RUN npm install
COPY src/ src/
RUN npx tsc
# Remove dev dependencies
RUN npm prune --omit=dev
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"]