File size: 1,083 Bytes
31e4457
c838ae8
31e4457
c838ae8
ef06cc4
c874a0f
ef06cc4
31e4457
 
 
 
c838ae8
e50d600
c874a0f
234eb74
 
1a5fe94
11c499a
1a5fe94
11c499a
d1d886d
 
e8284bf
a2fad95
7ab7719
e50d600
46368e2
c874a0f
d1d886d
c838ae8
c874a0f
492afa6
 
3dabab1
 
e50d600
d1d886d
 
c838ae8
d1d886d
 
 
ef06cc4
ab536fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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"]