Download Dockerfile from webolavo/aibuild: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/webolavo/aibuild/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/webolavo/aibuild/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/webolavo/aibuild/resolve/main/Dockerfile
1.16 kB
| FROM python:3.10-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| HF_HOME=/home/appuser/.cache/huggingface \ | |
| TOKENIZERS_PARALLELISM=false \ | |
| OMP_NUM_THREADS=2 \ | |
| MKL_NUM_THREADS=2 \ | |
| PORT=7860 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN useradd --create-home --uid 1000 appuser \ | |
| && mkdir -p /app /home/appuser/.cache/huggingface \ | |
| && chown -R appuser:appuser /app /home/appuser/.cache | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| COPY --chown=appuser:appuser app.py . | |
| USER appuser | |
| # Store the weights in the Docker image so restarts only load from local disk. | |
| RUN python -c "from transformers import AutoModelForZeroShotObjectDetection, AutoProcessor; model_id='IDEA-Research/grounding-dino-base'; AutoProcessor.from_pretrained(model_id); AutoModelForZeroShotObjectDetection.from_pretrained(model_id, low_cpu_mem_usage=True)" | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |