Spaces:
Runtime error
Runtime error
| # Base image with Python | |
| FROM python:3.11-slim | |
| # Set work directory | |
| WORKDIR /app | |
| # Install system dependencies (for psycopg2, etc.) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libpq-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements first (for caching layers) | |
| COPY requirements.txt . | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the app | |
| COPY . . | |
| # Expose port (Hugging Face will map this automatically) | |
| EXPOSE 7860 | |
| # Run the app (Uvicorn with auto-reload disabled for production) | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |