openclaw / Dockerfile
a8926764's picture
Update Dockerfile
ab536fc verified
FROM node:22-slim
ENV CI=true
# 1. 系统依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
python3 \
python3-pip \
make \
g++ \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
ENV TZ=Asia/Shanghai
# 2. 安装正确版本的 huggingface_hub
RUN pip3 install --break-system-packages --no-cache-dir \
huggingface_hub>=0.23.0 \
requests>=2.31.0
# 3. 安装 OpenClaw(非交互,稳定)
RUN npm install -g openclaw@latest \
&& openclaw --version \
&& npx --version
WORKDIR /app
# 4. 启动脚本
COPY start-openclaw.sh /usr/local/bin/start-openclaw.sh
RUN chmod +x /usr/local/bin/start-openclaw.sh
COPY sync.py /usr/local/bin/
RUN chmod +x /usr/local/bin/sync.py
COPY memory_sync.py /usr/local/bin/memory_sync.py
RUN chmod +x /usr/local/bin/memory_sync.py
# 5. 确保目录存在
RUN mkdir -p /root/.openclaw
# 6. 验证安装
RUN python3 -c "from huggingface_hub import HfApi; print('huggingface_hub 模块导入成功')" \
&& echo "依赖检查完成"
CMD ["/usr/local/bin/start-openclaw.sh"]