Spaces:
Running
Running
| # syntax=docker/dockerfile:1 | |
| FROM node:20-bookworm-slim | |
| WORKDIR /app | |
| # Install dependencies first (better layer caching) | |
| COPY package.json ./ | |
| RUN npm install --omit=dev | |
| # Copy the rest of the source | |
| COPY . . | |
| # Writable dir for uploaded files (Hugging Face runs containers as non-root) | |
| RUN mkdir -p /app/public/uploads \ | |
| && chmod -R 777 /app/public/uploads | |
| ENV NODE_ENV=production | |
| # Hugging Face Spaces expects the app to listen on port 7860 | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| CMD ["node", "src/index.js"] | |