Spaces:
Paused
Paused
Download Dockerfile from onlyrickroll/chat10: direct link, hf CLI and curl.
- Browser
- Download file 1.73 kB
-
https://huggingface.co/spaces/onlyrickroll/chat10/resolve/961beb202324ba7e576a9bba0b158366f501658e/Dockerfile
- Command line
-
hf download hf://spaces/onlyrickroll/chat10@961beb202324ba7e576a9bba0b158366f501658e/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/onlyrickroll/chat10/resolve/961beb202324ba7e576a9bba0b158366f501658e/Dockerfile
1.73 kB
| # 使用官方服务器镜像 | |
| FROM ghcr.io/ggml-org/llama.cpp:server | |
| # 切换到 root 安装必要工具 | |
| USER root | |
| RUN apt-get update && apt-get install -y python3-pip curl nginx && pip install huggingface_hub | |
| # 创建工作目录并赋权 (Space 官方要求非 root 运行) | |
| WORKDIR /app | |
| RUN chmod 777 /app | |
| # 使用 python 脚本下载模型,这样最稳,不需要处理复杂的 curl 参数 | |
| #RUN python3 -c "from huggingface_hub import hf_hub_download; \ | |
| # hf_hub_download(repo_id='Qwen/Qwen3-VL-8B-Instruct-GGUF', filename='Qwen3VL-8B-Instruct-Q4_K_M.gguf', local_dir='/app'); \ | |
| # hf_hub_download(repo_id='Qwen/Qwen3-VL-8B-Instruct-GGUF', filename='mmproj-Qwen3VL-8B-Instruct-Q8_0.gguf', local_dir='/app')" | |
| # 下载草稿模型 (建议用 Qwen2.5-1.5B-Instruct-GGUF 的 Q4_K_M 版本) | |
| RUN python3 -c "from huggingface_hub import hf_hub_download; \ | |
| hf_hub_download(repo_id='Qwen/Qwen3-VL-4B-Instruct-GGUF', \ | |
| filename='Qwen3VL-4B-Instruct-Q4_K_M.gguf', local_dir='/app')" | |
| # 拷贝脚本并赋权 | |
| COPY entrypoint.sh /app/entrypoint.sh | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| # 权限处理 | |
| RUN chmod +x /app/entrypoint.sh && \ | |
| touch /tmp/nginx.pid && \ | |
| chown -R 1000:1000 /app /etc/nginx /var/log/nginx /var/lib/nginx /tmp | |
| RUN useradd -m -u 1000 user &&chown -R 1000:1000 /home/user | |
| # 切换回 user (Space 默认用户 ID 通常是 1000) | |
| USER 1000 | |
| #RUN export HOME=/home/$(whoami) | |
| RUN python3 -m site --user-base | |
| #RUN chown -R $USER:$USER $HOME/.local $HOME/.cache | |
| RUN pip install uv --user &&uv tool install nanobot-ai --user | |
| #"-m", "/app/Qwen3VL-8B-Instruct-Q4_K_M.gguf", \ | |
| #"--mmproj", "/app/mmproj-Qwen3VL-8B-Instruct-Q8_0.gguf", \ | |
| ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"] | |