FROM node:latest

RUN apt-get update && apt-get install -y \
    chromium \
    libnss3-dev && \
    rm -rf /var/lib/apt/lists/*

ENV CHROME_BIN=/usr/bin/chromium

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

EXPOSE 7860

CMD ["node", "index.js"]