# Use lightweight Python base FROM python:3.10-slim WORKDIR /app RUN apt-get update && apt-get install -y eatmydata && eatmydata apt-get install -y --no-install-recommends build-essential # Install Python deps first (better caching) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy app code COPY . . # Default envs (can override at runtime) ENV OPENAI_API_KEY=sk-no-key-needed # If you’ll use docker-compose with a llama.cpp service named "llama": ENV OPENAI_API_BASE=http://llama:8001/v1 # Expose FastAPI port EXPOSE 8000 # Run server CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]