Spaces:
Sleeping
Sleeping
File size: 650 Bytes
bdb156f 0eb0abc bdb156f 0eb0abc 8c7e984 0eb0abc bdb156f 0eb0abc bdb156f 0eb0abc | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | FROM python:3.11-slim
WORKDIR /app
# Install deps first (cached layer — only invalidated when requirements change)
COPY requirements-server.txt .
RUN pip install --no-cache-dir -r requirements-server.txt
# Copy source (excludes venv/, training/, assets/, .git/ via .dockerignore)
COPY . .
# Pre-generate facts.json at build time; falls back gracefully if network is down
RUN python -m data.loader || echo "facts.json generation skipped — will use fallback facts"
EXPOSE 7860
# 2 workers: handles concurrent sessions without threading issues
CMD ["uvicorn", "environment.server:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]
|