Spaces:
Running
Running
| FROM python:3.13-slim | |
| # Install system dependencies required by fast-agent and HF Spaces | |
| RUN apt-get update && \ | |
| apt-get install -y \ | |
| bash \ | |
| git git-lfs \ | |
| wget curl procps \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install uv | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | |
| # Set working directory | |
| WORKDIR /app | |
| # Install fast-agent-mcp using uv | |
| RUN uv pip install --system --no-cache fast-agent-mcp | |
| # Copy all files from the Space repository to /app | |
| COPY --link ./ /app | |
| # Ensure /app is owned by uid 1000 (required for HF Spaces) | |
| RUN chown -R 1000:1000 /app | |
| # Switch to non-root user | |
| USER 1000 | |
| # Expose port 7860 (HF Spaces default) | |
| EXPOSE 7860 | |
| # Run fast-agent serve | |
| # The agent card (agent.md) and tool file (hf_api_tool.py) are in /app | |
| CMD ["fast-agent", "serve", "--card", "agent.md", "--transport", "http","--host","0.0.0.0", "--port", "7860", "--instance-scope","request"] | |