Spaces:
Runtime error
Runtime error
| FROM node:20-slim | |
| # Install latest chromium package and dependencies | |
| # This is crucial for fixing "missing Chrome" errors on Linux servers | |
| RUN apt-get update && apt-get install gnupg wget -y && \ | |
| wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/googlechrome-linux-keyring.gpg && \ | |
| sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/googlechrome-linux-keyring.gpg] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \ | |
| apt-get update && \ | |
| apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Tell Puppeteer to use the installed Chrome | |
| ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ | |
| PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable | |
| # Create app directory | |
| WORKDIR /usr/src/app | |
| # Copy package.json first for better Docker caching | |
| COPY package*.json ./ | |
| # Install npm dependencies | |
| RUN npm install | |
| # Copy all other project files | |
| COPY . . | |
| # Hugging Face exposes port 7860 by default | |
| EXPOSE 7860 | |
| # Start the bot | |
| CMD ["node", "server.js"] | |