Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| # Install libGL for OpenCV | |
| RUN apt-get update && apt-get install -y libgl1 && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Ensure pip install path is in PATH | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set working directory | |
| WORKDIR /app | |
| # Install Python deps | |
| COPY --chown=user requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY --chown=user . /app | |
| # Start FastAPI using uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |