Spaces:
Running
Running
| FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime | |
| WORKDIR /app | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # System deps | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxrender1 \ | |
| libxext6 \ | |
| libgl1-mesa-glx \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python deps | |
| COPY requirements_api.txt . | |
| RUN pip install --no-cache-dir -r requirements_api.txt | |
| # Copy all project files | |
| COPY . . | |
| # Download models before starting server | |
| CMD python download_models.py && uvicorn backend_api:app --host 0.0.0.0 --port 7860 | |