Qwen3_Medical / Dockerfile
lastmass's picture
Update Dockerfile
fd15357 verified
# Debian slim base, glibc compatible
FROM python:3.12-slim
# HF cache 指向可写目录
ENV HF_HOME=/tmp/.cache
ENV XDG_CACHE_HOME=/tmp/.cache
# 安装系统依赖 - 使用 libopenblas-dev 而不是 libblas3
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
wget \
libgomp1 \
libstdc++6 \
curl \
libopenblas-dev \
liblapack-dev \
&& rm -rf /var/lib/apt/lists/*
# 升级 pip / setuptools / wheel
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# 复制并安装本地 CPU-only wheel(linux_x86_64 + Python 3.12)
COPY llama_cpp_python-0.3.16-cp312-cp312-linux_x86_64.whl /tmp/
RUN pip install --no-cache-dir /tmp/llama_cpp_python-0.3.16-cp312-cp312-linux_x86_64.whl \
&& rm -f /tmp/llama_cpp_python-0.3.16-cp312-cp312-linux_x86_64.whl
# 安装 Python 依赖
RUN pip install --no-cache-dir gradio huggingface-hub
# 环境变量
ENV MODEL_DIR="/models"
ENV MODEL_FILE="Qwen3_Medical_GRPO.i1-Q4_K_M.gguf"
ENV MODEL_REPO="mradermacher/Qwen3_Medical_GRPO-i1-GGUF"
# 创建可写目录
RUN mkdir -p ${MODEL_DIR} /tmp/.cache \
&& chmod -R 0777 ${MODEL_DIR} /tmp/.cache
# 复制 app.py
COPY app.py /app/app.py
WORKDIR /app
# 暴露端口
EXPOSE 7860
# 启动
CMD ["python", "app.py"]