| # Use an official lightweight Python image | |
| FROM python:3.11-slim | |
| # Ensure stdout/stderr are unbuffered for real-time logs | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy and install dependencies | |
| COPY requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Expose application port | |
| EXPOSE 7860 | |
| # Run the FastAPI app with Uvicorn | |
| # The LLMINTROAPIKEY secret should be provided at runtime | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |