| FROM node:20-slim | |
| # Install git | |
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
| # Set working directory | |
| WORKDIR /app | |
| # Clone the repository | |
| RUN git clone https://github.com/vishalmysore/agentWorkBook.git . | |
| # Install dependencies | |
| RUN npm ci --only=production | |
| # Create directory for Gun.js data | |
| RUN mkdir -p radata-relay | |
| # Expose port 7860 (Hugging Face Spaces default) | |
| EXPOSE 7860 | |
| # Set environment variable for Hugging Face Spaces | |
| ENV PORT=7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --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 relay server | |
| CMD ["node", "relay-server.js"] |