SUgesto / Dockerfile
Gas1212
Fix Dockerfile: Add cmake and libopenblas for llama.cpp
fe08939
raw
history blame contribute delete
726 Bytes
FROM python:3.10-slim
WORKDIR /app
# Install system dependencies for llama.cpp compilation
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libopenblas-dev \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py .
# Expose FastAPI port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Run FastAPI with uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]