Download Dockerfile from Nicholas0205/opened-manhole-classifier: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Nicholas0205/opened-manhole-classifier/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Nicholas0205/opened-manhole-classifier/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Nicholas0205/opened-manhole-classifier/resolve/main/Dockerfile
1.02 kB
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| libglib2.0-0 \ | |
| libgl1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set up user with UID 1000 (standard for Hugging Face Spaces) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| # Copy requirements and install | |
| # We copy requirements first to leverage Docker cache | |
| COPY --chown=user requirements.txt ./requirements.txt | |
| RUN pip install --no-cache-dir --user --upgrade pip && \ | |
| pip install --no-cache-dir --user -r requirements.txt | |
| # Copy application files | |
| COPY --chown=user app ./app | |
| COPY --chown=user b0_v2.pth ./b0_v2.pth | |
| COPY --chown=user README.md ./README.md | |
| COPY --chown=user LICENSE ./LICENSE | |
| # Set environment variables | |
| ENV MODEL_PATH=$HOME/app/b0_v2.pth | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |