Spaces:
Paused
Paused
Download Dockerfile from onlyrickroll/chatrm: direct link, hf CLI and curl.
- Browser
- Download file 2.51 kB
-
https://huggingface.co/spaces/onlyrickroll/chatrm/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/onlyrickroll/chatrm/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/onlyrickroll/chatrm/resolve/main/Dockerfile
2.51 kB
| # 使用官方服务器镜像 | |
| FROM ghcr.io/ggml-org/llama.cpp:server | |
| # 切换到 root 安装必要工具 | |
| USER root | |
| RUN apt-get update && apt-get install -y python3 python3-pip nginx unzip && pip install huggingface_hub uv | |
| # 创建工作目录并赋权 (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')" | |
| # 下载草稿模型 (建议用 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-2B-Instruct-GGUF', \ | |
| # filename='Qwen3VL-2B-Instruct-Q4_K_M.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='unsloth/gpt-oss-20b-GGUF', \ | |
| # filename='gpt-oss-20b-Q4_K_M.gguf', local_dir='/app')" | |
| # 拷贝脚本并赋权 | |
| COPY entrypoint.sh /app/entrypoint.sh | |
| #COPY setup_proxy.sh /app/setup_proxy.sh | |
| COPY nginx.conf /etc/nginx/nginx.conf | |
| #COPY config.json /app/config.json | |
| COPY start_gost.sh /app/start_gost.sh | |
| #RUN curl -Iv 149.154.166.110 | |
| # 权限处理 | |
| 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 echo 'export PATH=$PATH:$HOME/.local/bin' >> ~/.bashrc && . ~/.bashrc | |
| ENV PATH ~/.local/bin:$PATH | |
| RUN uv tool install nanobot-ai | |
| #USER 1000 | |
| #"-m", "/app/Qwen3VL-8B-Instruct-Q4_K_M.gguf", \ | |
| #"--mmproj", "/app/mmproj-Qwen3VL-8B-Instruct-Q8_0.gguf", \ | |
| ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"] | |