Spaces:
Running on Zero
Running on Zero
Download Dockerfile from devYoda/scanlens-models: direct link, hf CLI and curl.
- Browser
- Download file 734 Bytes
-
https://huggingface.co/spaces/devYoda/scanlens-models/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/devYoda/scanlens-models/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/devYoda/scanlens-models/resolve/main/Dockerfile
734 Bytes
| # For Hugging Face Spaces (Docker SDK). Spaces runs the container as user 1000 and sends traffic to port 7860. | |
| FROM python:3.11-slim | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH \ | |
| HF_HOME=/home/user/.cache/huggingface \ | |
| HOST=0.0.0.0 PORT=7860 PYTHONUNBUFFERED=1 | |
| WORKDIR /home/user/app | |
| # CPU-only torch first: the default Linux wheel pulls in several GB of CUDA libraries a CPU Space can't use. | |
| RUN pip install --no-cache-dir --user torch==2.9.1 --index-url https://download.pytorch.org/whl/cpu | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| COPY --chown=user server.py references.json ./ | |
| EXPOSE 7860 | |
| CMD ["python", "server.py"] | |