| # Use a lightweight Node.js image | |
| FROM node:18-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy package files and install dependencies | |
| COPY package*.json ./ | |
| RUN npm install --production | |
| # Copy the rest of the application code | |
| COPY . . | |
| # Hugging Face Spaces requires the app to listen on port 7860 | |
| ENV PORT=7860 | |
| ENV NODE_ENV=production | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Start the application directly | |
| CMD ["node", "server/index.js"] | |