Spaces:
Running
on
T4
Running
on
T4
| # Use slim Python base | |
| FROM python:3.10-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| WORKDIR /app | |
| # System deps for OpenCV and PIL | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| ffmpeg \ | |
| libsm6 \ | |
| libxext6 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy project | |
| COPY requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| # Ensure writable dirs for API | |
| RUN mkdir -p /data/uploads /data/outputs && chmod -R 777 /data | |
| # Expose HF Spaces default port | |
| EXPOSE 7860 | |
| # Start FastAPI | |
| CMD ["python3", "-m", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"] | |