File size: 484 Bytes
2522dc6 0373b7d 2522dc6 4755549 2522dc6 4755549 a3ab019 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | # Stage 1: Build llama-cpp-python
FROM python:3.11-slim as builder
RUN apt-get update && apt-get install -y git build-essential cmake wget
RUN pip wheel --no-cache-dir llama-cpp-python==0.1.79 -w /wheels
# Stage 2: Final image
FROM python:3.11-slim
WORKDIR /app
COPY --from=builder /wheels /wheels
RUN pip install --no-cache-dir /wheels/* fastapi "uvicorn[standard]" requests
COPY . /app
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |