# Base image with Node.js and Puppeteer dependencies FROM node:20-slim # Install dependencies required for Puppeteer RUN apt-get update && apt-get install -y \ libnss3 \ libatk1.0-0 \ libpangocairo-1.0-0 \ libx11-xcb1 \ libxcomposite1 \ libxcursor1 \ libxdamage1 \ libxfixes3 \ libxi6 \ libxrandr2 \ libxrender1 \ libxss1 \ libxtst6 \ ca-certificates \ fonts-liberation \ libasound2 \ libgbm1 \ libgtk-3-0 \ xdg-utils \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy package.json and install dependencies COPY package.json ./ RUN npm install cheerio puppeteer-extra puppeteer-extra-plugin-stealth puppeteer # Run npx to install Puppeteer manually RUN npx install puppeteer # Copy project files COPY . . EXPOSE 7860 # Start script CMD ["node", "index.js"]