Download Dockerfile from nexusbert/3D: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/spaces/nexusbert/3D/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/nexusbert/3D/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/nexusbert/3D/resolve/main/Dockerfile
1.35 kB
| # Base Image | |
| FROM python:3.10-slim | |
| # Build argument for Hugging Face token | |
| ARG HF_TOKEN | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| HF_TOKEN=${HF_TOKEN} \ | |
| PYOPENGL_PLATFORM=osmesa \ | |
| DISPLAY=:99 | |
| WORKDIR /code | |
| # System Dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| git \ | |
| curl \ | |
| libopenblas-dev \ | |
| libomp-dev \ | |
| libosmesa6-dev \ | |
| libglib2.0-0 \ | |
| libx11-6 \ | |
| libxext6 \ | |
| libxrender1 \ | |
| libgl1-mesa-dri \ | |
| mesa-common-dev \ | |
| libglu1-mesa-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Hugging Face + model tools | |
| RUN pip install --no-cache-dir huggingface-hub sentencepiece accelerate | |
| # Hugging Face cache environment | |
| ENV HF_HOME=/models/huggingface \ | |
| HUGGINGFACE_HUB_CACHE=/models/huggingface \ | |
| HF_HUB_CACHE=/models/huggingface | |
| # Created cache dir and set permissions | |
| RUN mkdir -p /models/huggingface && chmod -R 777 /models/huggingface | |
| # Create SMPL models directory | |
| RUN mkdir -p /code/models/smpl && chmod -R 777 /code/models | |
| # Copy project files | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |