| # Use a minimal base image | |
| FROM python:3.10-slim | |
| # Set environment variables | |
| ENV PORT 7860 | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy files | |
| COPY main.py . | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose the port for Hugging Face | |
| EXPOSE 7860 | |
| # Start the FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |