File size: 878 Bytes
04e6c77
 
cd0c04f
 
 
 
 
 
 
 
 
 
04e6c77
 
 
65d5480
04e6c77
65d5480
04e6c77
 
 
 
cd0c04f
 
 
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
FROM python:3.11-slim

# HF Spaces requires user ID 1000
RUN useradd -m -u 1000 user
WORKDIR /home/user/app

# Copy source and install
COPY --chown=user pyproject.toml .
COPY --chown=user agent_bench/ agent_bench/
COPY --chown=user configs/ configs/
COPY --chown=user data/ data/
COPY --chown=user scripts/ scripts/

RUN pip install --no-cache-dir .

# Pre-download models at build time
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
RUN python -c "from sentence_transformers import CrossEncoder; CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')"

# Run ingestion at build time so the store is ready
RUN python scripts/ingest.py --doc-dir data/tech_docs/ --store-path .cache/store

USER user
EXPOSE 7860
CMD ["uvicorn", "agent_bench.serving.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "7860"]