File size: 877 Bytes
791c906
 
 
 
 
 
 
 
 
 
 
 
 
2fd1134
 
 
791c906
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.11-slim

# HF Spaces runs as user 1000
RUN useradd -m -u 1000 user
WORKDIR /app

# Install dependencies first (layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy app code (tools.py нужен только при ENABLE_TOOLS=1; при 0 не импортируется)
COPY app_2.py tools.py .

# In-app eval harness (admin panel «Проверка сценариев»)
COPY evals/ ./evals/

# Create writable dirs for FAISS cache (HF Spaces filesystem)
RUN mkdir -p /app/faiss_index && chown -R user:user /app

USER user

# Expose Streamlit default port
EXPOSE 7860

# HF Spaces expects port 7860
CMD ["streamlit", "run", "app_2.py", \
     "--server.port=7860", \
     "--server.address=0.0.0.0", \
     "--server.headless=true", \
     "--server.enableCORS=false", \
     "--server.enableXsrfProtection=false"]