Download Dockerfile from Um35h/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/spaces/Um35h/openclaw/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Um35h/openclaw/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Um35h/openclaw/resolve/main/Dockerfile
1.76 kB
| FROM node:22-slim | |
| ARG APP_HOME=/root/.openclaw | |
| ARG SCRIPTS_DIR=/usr/local/bin | |
| # 0. 创建基础目录 | |
| RUN mkdir -p ${APP_HOME} | |
| # 1. 安装系统依赖 | |
| # 优化:合并 RUN 指令,减少层数;确保证书更新在安装后立即执行 | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| openssh-client \ | |
| build-essential \ | |
| g++ \ | |
| make \ | |
| python3 \ | |
| python3-pip \ | |
| python3-venv \ | |
| ca-certificates \ | |
| jq \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && update-ca-certificates | |
| # 2. 安装 Hugging Face 命令行工具 | |
| RUN pip3 install --no-cache-dir huggingface_hub --break-system-packages | |
| # 3. 配置 Git | |
| RUN git config --global url."https://github.com/".insteadOf ssh://git@github.com/ && \ | |
| git config --global --add safe.directory "*" | |
| # 4. 全局安装 OpenClaw | |
| RUN npm install -g openclaw@latest --unsafe-perm | |
| # 5. 复制所有脚本和模板 | |
| COPY scripts/sync.py ${SCRIPTS_DIR}/sync.py | |
| COPY scripts/pending.py ${SCRIPTS_DIR}/pending.py | |
| COPY scripts/start-openclaw.sh ${SCRIPTS_DIR}/start-openclaw.sh | |
| COPY scripts/telegram-dns-check.sh ${SCRIPTS_DIR}/telegram-dns-check.sh | |
| COPY config/openclaw.json ${APP_HOME}/openclaw.json | |
| # 赋予执行权限 | |
| RUN chmod +x ${SCRIPTS_DIR}/sync.py ${SCRIPTS_DIR}/pending.py ${SCRIPTS_DIR}/start-openclaw.sh ${SCRIPTS_DIR}/telegram-dns-check.sh | |
| # 6. 设置环境变量 | |
| ENV PORT=7860 \ | |
| OPENCLAW_GATEWAY_MODE=local \ | |
| HOME=/root \ | |
| PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 | |
| # 7. 暴露端口 | |
| EXPOSE ${PORT} | |
| # 8. 健康检查 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ | |
| CMD curl -f http://localhost:${PORT}/health || exit 1 | |
| # 9. 入口点 | |
| ENTRYPOINT ["/usr/local/bin/start-openclaw.sh"] |