FROM node:22-slim # Install Chromium system dependencies RUN apt-get update && apt-get install -y \ chromium \ fonts-liberation \ libgbm1 \ libnss3 \ libatk1.0-0 \ libatk-bridge2.0-0 \ libcups2 \ libxdamage1 \ libxrandr2 \ libpango-1.0-0 \ libcairo2 \ libasound2 \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy package configurations COPY package*.json tsconfig.json ./ RUN npm ci # Copy source and build COPY src/ ./src/ RUN npm run build # Prune dev dependencies to reduce image size RUN npm prune --production # Install Playwright Chromium browser RUN npx playwright install chromium ENV NODE_ENV=production ENV PLAYWRIGHT_HEADLESS=true ENV PORT=7860 EXPOSE 7860 CMD ["node", "dist/index.js"]