Spaces:
Running
Running
File size: 922 Bytes
cc49c15 cf9af9f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
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"]
|