File size: 956 Bytes
a60a605
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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 for fast, reliable package management
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Set working directory
WORKDIR /app

# Install fast-agent-mcp from PyPI
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 with request-scoped instances for token passthrough
CMD ["fast-agent", "serve", "--card", "hf_hub_community.md", "--transport", "http", "--instance-scope", "request", "--host", "0.0.0.0", "--port", "7860"]