Spaces:
Running
Running
Aaryan Parik
fix: harden HF Space Docker runtime, session isolation, hardware profiles, and tests
0a7b128 Download Dockerfile from SnippyCodes/Libratio: direct link, hf CLI and curl.
- Browser
- Download file 532 Bytes
-
https://huggingface.co/spaces/SnippyCodes/Libratio/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/SnippyCodes/Libratio/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/SnippyCodes/Libratio/resolve/main/Dockerfile
532 Bytes
| FROM python:3.12-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY --chown=user:user . . | |
| USER user | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7860/health', timeout=3)" || exit 1 | |
| CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |