Files
pdga-rating/Dockerfile
T
Samuel Enocsson d567c4bca9 fix: upgrade Node 18 to 22 and fix Puppeteer compatibility
- Switch from Alpine to Debian slim for correct Chromium architecture
  (fixes ARM/Apple Silicon support)
- Upgrade Puppeteer 21 to 24, use system Chromium via PUPPETEER_EXECUTABLE_PATH
- Replace removed page.waitForTimeout() with setTimeout
- Set NODE_ENV=production in Dockerfile to prevent pino-pretty import
- Improve error logging with Pino's { err: error } pattern
- Add build: . to docker-compose for local development builds
2026-03-20 07:39:34 +01:00

39 lines
820 B
Docker

# Use official Node.js runtime as base image
FROM node:22-slim
# Install Chromium from Debian repos (correct architecture for ARM/x86)
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium \
ca-certificates \
fonts-freefont-ttf \
&& rm -rf /var/lib/apt/lists/*
# Use system Chromium instead of Puppeteer's bundled download
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy application code
COPY . .
# Create data directory
RUN mkdir -p data
# Set database path
ENV DB_PATH=/app/data/ratings.db \
NODE_ENV=production
# Expose port
EXPOSE 3000
# Start the application
CMD ["npm", "start"]