zhvzii commited on
Commit
f77018d
·
verified ·
1 Parent(s): bed3e6f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -5
Dockerfile CHANGED
@@ -1,6 +1,24 @@
1
- # Dockerfile 示例(仅作参考)
2
- FROM node:22
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
- RUN git clone https://github.com/openclaw/openclaw.git .
5
- RUN npm install
6
- CMD ["npm", "start"]
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM node:22-slim
3
+
4
+ # 安装 pnpm(关键步骤)
5
+ RUN npm install -g pnpm corepack && corepack enable
6
+
7
+ # 安装构建依赖(OpenClaw 需要编译 native 模块)
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ python3 \
11
+ pkg-config \
12
+ libvips-dev \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # 克隆 OpenClaw 源码
16
  WORKDIR /app
17
+ RUN git clone https://github.com/openclaw/openclaw.git . \
18
+ && pnpm install --frozen-lockfile
19
+
20
+ # 持久化数据目录(但 Spaces 免费版仍会丢失)
21
+ VOLUME ["/root/.openclaw"]
22
+
23
+ # 启动 OpenClaw
24
+ CMD ["pnpm", "start"]