Spaces:
Sleeping
Sleeping
| FROM python:3.11 | |
| # Install modern system dependencies for OpenCV (libgl1 replaces libgl1-mesa-glx) | |
| RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/* | |
| # Add user to avoid permission issues (HuggingFace Spaces REQUIRE this) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| WORKDIR $HOME/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY --chown=user . . | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |