Spaces:
Runtime error
Runtime error
| # Use Node.js LTS as base image | |
| FROM node:18-alpine | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy package files | |
| COPY package*.json ./ | |
| # Install dependencies | |
| RUN npm install --production | |
| # Copy application files | |
| COPY server.js ./ | |
| COPY public ./public | |
| # Expose port | |
| EXPOSE 7860 | |
| # Set environment variable for port | |
| ENV PORT=7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ | |
| CMD node -e "require('http').get('http://localhost:7860/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})" | |
| # Start the application | |
| CMD ["node", "server.js"] |