Spaces:
Running
Running
| 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, ingest, and app files needed for the build step | |
| COPY --chown=user requirements.txt /app/requirements.txt | |
| COPY --chown=user ingest.py /app/ingest.py | |
| # Install dependencies | |
| # RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| # wget \ | |
| # build-essential \ | |
| # && rm -rf /var/lib/apt/lists/* | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # This ensures the DB uses the correct environment dependencies. | |
| RUN python ingest.py | |
| # ------------------------------------------------------------- | |
| # Copy the rest of the application files | |
| COPY --chown=user . /app | |
| # Expose port 7860 (HuggingFace Space default) | |
| EXPOSE 7860 | |
| # Run the MCP server with authentication proxy | |
| CMD ["python", "app.py"] |