forked from justlovemaki/openclaw-docker-cn-im
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
84 lines (64 loc) · 2.33 KB
/
Dockerfile
File metadata and controls
84 lines (64 loc) · 2.33 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# OpenClaw Docker 镜像
FROM node:22-slim
# 设置工作目录
WORKDIR /app
# 安装必要的系统依赖
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
chromium \
curl \
fonts-liberation \
fonts-noto-cjk \
fonts-noto-color-emoji \
git \
gosu \
jq \
python3 \
socat \
tini \
websockify \
&& rm -rf /var/lib/apt/lists/*
# 更新 npm 到最新版本
RUN npm install -g npm@latest
# 安装 OpenClaw 和 OpenCode AI
RUN npm install -g openclaw@2026.2.6-3 opencode-ai@latest
# 安装 Playwright 和 Chromium
RUN npm install -g playwright && npx playwright install chromium --with-deps
# 安装 playwright-extra 和 puppeteer-extra-plugin-stealth
RUN npm install -g playwright-extra puppeteer-extra-plugin-stealth
# 安装 bird
RUN npm install -g @steipete/bird
# 创建配置目录并设置权限
RUN mkdir -p /home/node/.openclaw/workspace && \
chown -R node:node /home/node
# 切换到 node 用户安装插件
USER node
# 安装飞书插件 - 使用 timeout 防止卡住,忽略错误继续构建
RUN timeout 300 openclaw plugins install @m1heng-clawd/feishu || true
# 安装钉钉插件 - 使用 timeout 防止卡住,忽略错误继续构建
RUN timeout 300 openclaw plugins install https://github.com/soimy/clawdbot-channel-dingtalk.git || true
# 安装 QQ 机器人插件 - 使用 timeout 防止卡住,忽略错误继续构建
RUN cd /tmp && \
git clone https://github.com/justlovemaki/qqbot.git && \
cd qqbot && \
timeout 300 openclaw plugins install . || true
# 安装企业微信插件 - 使用 timeout 防止卡住,忽略错误继续构建
RUN timeout 300 openclaw plugins install @sunnoy/wecom || true
# 切换回 root 用户继续后续操作
USER root
# 确保 extensions 目录权限正确(排除 node_modules 以加快构建速度)
RUN find /home/node/.openclaw/extensions -type d -name node_modules -prune -o -exec chown node:node {} +
# 复制初始化脚本
COPY ./init.sh /usr/local/bin/init.sh
RUN chmod +x /usr/local/bin/init.sh
# 设置基础环境变量
ENV HOME=/home/node \
TERM=xterm-256color
# 暴露端口
EXPOSE 18789 18790
# 设置工作目录为 home
WORKDIR /home/node
# 使用初始化脚本作为入口点(以 root 运行以便修复权限)
ENTRYPOINT ["/bin/bash", "/usr/local/bin/init.sh"]