From 6e597f15ca6ecf9a10e7092d2181707d954fb0aa Mon Sep 17 00:00:00 2001 From: Kelly Date: Fri, 28 Nov 2025 20:08:57 -0700 Subject: [PATCH] Fix Dockerfile for Puppeteer/Chromium support --- backend/Dockerfile | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 9067022d..84592ca0 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,36 +1,40 @@ # Build stage -FROM node:20-alpine AS builder +FROM node:20-slim AS builder WORKDIR /app -# Copy package files COPY package*.json ./ - -# Install dependencies RUN npm ci -# Copy source code COPY . . - -# Build TypeScript RUN npm run build # Production stage -FROM node:20-alpine +FROM node:20-slim + +# Install Chromium dependencies +RUN apt-get update && apt-get install -y \ + chromium \ + fonts-liberation \ + libnss3 \ + libxss1 \ + libasound2 \ + libatk-bridge2.0-0 \ + libgtk-3-0 \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +# Tell Puppeteer to use system Chromium +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true +ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium WORKDIR /app -# Copy package files COPY package*.json ./ - -# Install production dependencies only RUN npm ci --only=production -# Copy built code from builder COPY --from=builder /app/dist ./dist -# Expose port EXPOSE 3010 -# Start the application CMD ["node", "dist/index.js"]