| FROM python:3.11-slim | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copy requirements and install dependencies | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY --chown=user app/ app/ | |
| COPY --chown=user prompts/ prompts/ | |
| COPY --chown=user start.sh . | |
| # Make start script executable | |
| RUN chmod +x start.sh | |
| # Expose HF Space port | |
| EXPOSE 7860 | |
| # Run the FastAPI application | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |