Spaces:
Running
Running
| FROM python:3.12-slim | |
| # Hugging Face Spaces run containers as uid 1000. | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PYTHONUNBUFFERED=1 \ | |
| EXPLORER_DATA_DIR=/home/user/runtime \ | |
| EXPLORER_CACHE=/home/user/cache | |
| WORKDIR /home/user/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| COPY --chown=user app ./app | |
| COPY --chown=user static ./static | |
| COPY --chown=user bench ./bench | |
| COPY --chown=user data ./data | |
| EXPOSE 7860 | |
| # --timeout-graceful-shutdown lets the sink flush buffered events when the Space stops. | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers", "--forwarded-allow-ips", "*", "--timeout-graceful-shutdown", "20", "--no-access-log"] | |