Spaces:
Sleeping
Sleeping
| # Use a lightweight Python base image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /code | |
| # Copy dependency list first (to use Docker cache efficiently) | |
| COPY requirements.txt . | |
| # Install system dependencies and git (needed for CLIP) | |
| RUN apt-get update && \ | |
| apt-get install -y git && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy all project files into the container | |
| COPY . . | |
| # Expose the port Hugging Face Spaces uses | |
| EXPOSE 7860 | |
| # Command to run the FastAPI app | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |