| |
| FROM ghcr.io/ggml-org/llama.cpp:full AS builder |
|
|
| WORKDIR /app |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3 python3-pip python3-venv \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN python3 -m venv /opt/venv |
| ENV PATH="/opt/venv/bin:$PATH" |
|
|
| RUN pip install --no-cache-dir -U pip huggingface_hub |
|
|
| RUN python3 -c 'from huggingface_hub import hf_hub_download; \ |
| hf_hub_download(repo_id="Abiray/MiniCPM5-1B-GGUF", \ |
| filename="minicpm5-1b-Q4_K_M.gguf", \ |
| local_dir="/app")' |
|
|
| |
| FROM ghcr.io/ggml-org/llama.cpp:full |
|
|
| |
| RUN useradd -m -u 1000 user |
|
|
| WORKDIR /app |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:/opt/venv/bin:$PATH \ |
| PYTHONUNBUFFERED=1 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| python3 python3-pip python3-venv \ |
| ffmpeg \ |
| libgomp1 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY --from=builder /opt/venv /opt/venv |
|
|
| |
| RUN pip install --no-cache-dir flask edge-tts llama-cpp-python \ |
| && rm -rf /root/.cache/pip |
|
|
| |
| COPY --from=builder /app/minicpm5-1b-Q4_K_M.gguf /app/minicpm5-1b-Q4_K_M.gguf |
|
|
| |
| |
| COPY --chown=user:user app.py /app/app.py |
| COPY --chown=user:user model /app/model |
| COPY --chown=user:user animation /app/animation |
|
|
| |
| RUN chown -R user:user /app |
|
|
| USER user |
|
|
| EXPOSE 7860 |
|
|
| ENTRYPOINT [] |
| CMD ["python3", "/app/app.py"] |
|
|