openwolf-vision / Dockerfile
hugh007's picture
fix: use pre-compiled llama-cpp-python wheel + model in image
0408500 verified
raw
history blame contribute delete
927 Bytes
FROM python:3.12
WORKDIR /app
# llama-cpp-python 预编译 wheel(30 秒,不需编译)
RUN pip install --no-cache-dir --timeout 300 "llama-cpp-python>=0.3.4" \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
# 下载 GGUF 多模态模型(构建时打包进镜像)
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app/models && \
curl -sL -o /app/models/MiniCPM-V-4.6-Q4_K_M.gguf \
"https://huggingface.co/ggml-org/MiniCPM-V-4.6-GGUF/resolve/main/MiniCPM-V-4.6-Q4_K_M.gguf" && \
curl -sL -o /app/models/mmproj-MiniCPM-V-4.6-Q8_0.gguf \
"https://huggingface.co/ggml-org/MiniCPM-V-4.6-GGUF/resolve/main/mmproj-MiniCPM-V-4.6-Q8_0.gguf"
COPY requirements.txt .
RUN pip install -r requirements.txt --no-cache-dir
COPY app.py .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]