FROM node:18-slim # Install system dependencies for Playwright RUN apt-get update && apt-get install -y wget ca-certificates fonts-liberation libasound2 libatk-bridge2.0-0 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libgtk-3-0 libnspr4 libnss3 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils # Set environment variables so Playwright installs correctly ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright # Set working directory WORKDIR /app # Install node modules COPY package.json ./ RUN npm install # Install Playwright browsers RUN npx playwright install chromium # Copy app code COPY . . # Expose port EXPOSE 7860 # Start app CMD ["node", "index.js"]