Spaces:
Sleeping
Sleeping
| # New NAI - Hugging Face Spaces Dockerfile (Node.js/Express) | |
| # Ensures binding to $PORT and 0.0.0.0, no browser auto-open. | |
| FROM node:20-bullseye-slim | |
| ENV NODE_ENV=production \ | |
| HOST=0.0.0.0 \ | |
| AUTO_OPEN_BROWSER=0 | |
| WORKDIR /app | |
| # Install production deps first (layer cache friendly) | |
| COPY package.json package-lock.json* ./ | |
| RUN npm ci --only=production || npm install --only=production | |
| # Copy the rest of the app | |
| COPY . . | |
| # Optional (uncomment if curl-based healthcheck is used) | |
| # RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* | |
| # Spaces provides $PORT. We just run and listen on host 0.0.0.0. | |
| EXPOSE 7860 | |
| CMD ["node", "server.js"] |