Spaces:
Sleeping
Sleeping
| # Use a lightweight Python base image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install Git and Git LFS | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| git-lfs \ | |
| libgl1-mesa-glx \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy all files (including .gitattributes for LFS) | |
| COPY . . | |
| # Fetch LFS files explicitly | |
| RUN git lfs install && git lfs pull | |
| # Copy requirements file and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose the port Hugging Face Spaces expects | |
| EXPOSE 7860 | |
| # Run the FastAPI app with Uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |