Spaces:
Sleeping
Sleeping
Download Dockerfile from kabeerahmad/Categorization: direct link, hf CLI and curl.
- Browser
- Download file 865 Bytes
-
https://huggingface.co/spaces/kabeerahmad/Categorization/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/kabeerahmad/Categorization/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/kabeerahmad/Categorization/resolve/main/Dockerfile
865 Bytes
| # βββ Dockerfile βββββββββββββββββββββββββββββββββ | |
| FROM python:3.10-slim | |
| # 1) Install system deps + git for pip/git installs | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends \ | |
| git \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2) Workdir & copy requirements | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| # 3) Install Python deps **as root** so that uvicorn ends up in /usr/local/bin | |
| RUN pip install --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # 4) Create non-root user and switch | |
| RUN useradd --create-home appuser | |
| USER appuser | |
| # 5) Copy your code (owned by appuser) | |
| COPY --chown=appuser . . | |
| # 6) Expose & launch | |
| EXPOSE 8000 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |