Download Dockerfile from Rolaficus/rcnn: direct link, hf CLI and curl.
- Browser
- Download file 776 Bytes
-
https://huggingface.co/spaces/Rolaficus/rcnn/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Rolaficus/rcnn/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Rolaficus/rcnn/resolve/main/Dockerfile
776 Bytes
| FROM python:3.9-slim | |
| # 1. Install system dependencies required by OpenCV (must be run as root) | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxrender1 \ | |
| libxext6 \ | |
| libxcb1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Set up the non-root user (Required by Hugging Face) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # 3. Set the working directory | |
| WORKDIR /app | |
| # 4. Copy requirements and install dependencies | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # 5. Copy the rest of your application code | |
| COPY --chown=user . /app | |
| # 6. Start the FastAPI server | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |