feat: Update Dockerfile and app.py to enhance MCP server with landing page and updated SSE endpoint
982515c
| # FleetMind MCP Server - HuggingFace Space Dockerfile | |
| # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
| FROM python:3.11-slim | |
| # Create non-root user (HuggingFace requirement) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements first (for better caching) | |
| COPY --chown=user requirements.txt /app/requirements.txt | |
| # Install dependencies | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy application files | |
| COPY --chown=user . /app | |
| # Create logs directory | |
| RUN mkdir -p /app/logs | |
| # Expose port 7860 (HuggingFace Space default) | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD python -c "import requests; requests.get('http://localhost:7860')" || exit 1 | |
| # Run the MCP server with landing page | |
| CMD ["python", "app.py"] | |