Spaces:
Running
Running
Download Dockerfile from RDS777/TARGET_SPACE: direct link, hf CLI and curl.
- Browser
- Download file 978 Bytes
-
https://huggingface.co/spaces/RDS777/TARGET_SPACE/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/RDS777/TARGET_SPACE/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/RDS777/TARGET_SPACE/resolve/main/Dockerfile
978 Bytes
| # Hugging Face Space (SDK docker). Variante CPU par défaut ; GPU : --build-arg TORCH_VARIANT=gpu | |
| FROM python:3.12-slim | |
| ARG TORCH_VARIANT=cpu | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PORT=7860 \ | |
| MOUH_DATA_DIR=/home/user/data \ | |
| HOME=/home/user | |
| # Utilisateur non-root (exigé par les Spaces) : l'isolation des skills repose sur ce conteneur | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /home/user/app | |
| COPY --chown=user requirements.txt requirements-dev.txt ./ | |
| RUN if [ "$TORCH_VARIANT" = "cpu" ]; then \ | |
| pip install --index-url https://download.pytorch.org/whl/cpu torch ; \ | |
| else \ | |
| pip install torch triton ; \ | |
| fi \ | |
| && pip install -r requirements.txt | |
| COPY --chown=user . . | |
| USER user | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=40s CMD python -c "import urllib.request,os;urllib.request.urlopen('http://127.0.0.1:'+os.environ.get('PORT','7860'))" || exit 1 | |
| CMD ["python", "app.py"] | |