Download Dockerfile from desinez/PvRecNet: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/spaces/desinez/PvRecNet/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/desinez/PvRecNet/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/desinez/PvRecNet/resolve/main/Dockerfile
1.13 kB
| FROM python:3.10-slim | |
| # Install system dependencies if your ML models require compiling (optional but safe) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user for Hugging Face security compliance | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| # Force Python to look at the root directory for module imports | |
| ENV PYTHONPATH="/code" | |
| WORKDIR /code | |
| # Copy and install requirements | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the entire project structure over | |
| COPY --chown=user . . | |
| # βββ ADD THIS LINE TO INSTALL YOUR LOCAL PACKAGE ββββββββββββββββββ | |
| # This explicitly runs 'pip install' inside the folder containing your pyproject.toml | |
| RUN pip install --no-cache-dir ./backend/PvDeepSetNet | |
| # Expose the mandatory Hugging Face port | |
| EXPOSE 7860 | |
| # Run Uvicorn pointing directly to your backend's main.py FastAPI instance | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |