Spaces:
Sleeping
Sleeping
Download backend/Dockerfile from edichat/edi.chat.test: direct link, hf CLI and curl.
- Browser
- Download file 714 Bytes
-
https://huggingface.co/spaces/edichat/edi.chat.test/resolve/main/backend/Dockerfile
- Command line
-
hf download hf://spaces/edichat/edi.chat.test/backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/edichat/edi.chat.test/resolve/main/backend/Dockerfile
714 Bytes
| # Backend Dockerfile for edi.chat API | |
| FROM node:20-alpine | |
| # Create app directory | |
| WORKDIR /app | |
| # Create non-root user for security | |
| RUN addgroup -g 1001 -S nodejs && \ | |
| adduser -S edichat -u 1001 | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install dependencies with better error handling | |
| RUN npm ci --only=production --verbose && \ | |
| npm cache clean --force | |
| # Copy source code | |
| COPY . . | |
| # Create logs directory | |
| RUN mkdir -p logs && \ | |
| chown -R edichat:nodejs /app | |
| # Switch to non-root user | |
| USER edichat | |
| # Expose port | |
| EXPOSE 5000 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ | |
| CMD node healthcheck.js || exit 1 | |
| # Start the application | |
| CMD ["npm", "start"] |