| # 1. Start with a lightweight Linux image that has Python | |
| FROM python:3.10-slim | |
| # 2. Set the working directory inside the container | |
| WORKDIR /app | |
| # 3. Install system dependencies (needed for llama-cpp) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 4. Copy your requirements file and install them | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 5. Copy your application code | |
| COPY . . | |
| # 6. Expose the port your FastAPI app uses | |
| EXPOSE 7860 | |
| # 7. Command to run your app | |
| CMD ["python", "app.py"] | |