| # Use a lightweight Node.js image | |
| FROM node:20-slim | |
| # Create app directory | |
| WORKDIR /usr/src/app | |
| # Copy package files first to optimize Docker layer caching | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm install | |
| # Copy all the remaining project files | |
| COPY . . | |
| # Define the port Hugging Face Spaces expects apps to run on | |
| EXPOSE 7860 | |
| # Force the bot's keep-alive web server to run on port 7860 | |
| ENV PORT=7860 | |
| # Command to start the bot | |
| CMD [ "npm", "start" ] | |