Spaces:
Sleeping
Sleeping
| # Use a lightweight Python image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies for C++ (needed for some AI libs) | |
| RUN apt-get update && apt-get install -y gcc g++ git && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy your code | |
| COPY . . | |
| # Hugging Face Spaces uses port 7860 by default | |
| EXPOSE 7860 | |
| # Command to run your FastAPI app | |
| CMD ["bash", "-lc", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |