syw1516 commited on
Commit
e8d4e69
·
verified ·
1 Parent(s): d977bc1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -36
Dockerfile CHANGED
@@ -1,44 +1,53 @@
1
- FROM node:22-slim
2
-
3
- # 1. Base dependencies
4
- RUN apt-get update && apt-get install -y --no-install-recommends \
5
- git openssh-client build-essential python3 python3-pip \
6
- g++ make ca-certificates curl jq bash && \
7
- rm -rf /var/lib/apt/lists/*
8
-
9
- # 2. Install Python dependencies
10
- RUN pip3 install --no-cache-dir --break-system-packages \
11
- huggingface_hub \
12
- requests \
13
- supabase
14
-
15
- # 3. Git SSL improvements
16
- RUN update-ca-certificates && \
17
- git config --global http.sslVerify false && \
18
- git config --global url."https://github.com/".insteadOf ssh://git@github.com/
19
-
20
- # 4. Install OpenClaw globally
21
- RUN npm install -g openclaw --unsafe-perm
22
-
23
- # 5. Create necessary directories
24
- RUN mkdir -p /root/.openclaw/agents/main/sessions && \
25
- mkdir -p /root/.openclaw/credentials && \
26
- mkdir -p /root/.openclaw/sessions
27
-
28
- # 6. Set working directory
29
- WORKDIR /app
30
-
31
- # 7. Copy entrypoint and scripts
 
 
32
  COPY scripts/openclaw-entrypoint.sh /usr/local/bin/openclaw-entrypoint.sh
33
- RUN chmod +x /usr/local/bin/openclaw-entrypoint.sh
 
 
 
34
 
35
- # 8. Environment variables
36
  ENV PORT=7860
37
- ENV HF_SPACE_NO_HEALTH_CHECK=1
 
38
 
39
- # 9. Expose port
40
  EXPOSE 7860
41
 
42
- # 10. Use entrypoint
 
 
43
  ENTRYPOINT ["/usr/local/bin/openclaw-entrypoint.sh"]
 
 
44
  CMD ["gateway"]
 
1
+ # 使用 Ubuntu 24.04 基础镜像(与 README 一致)
2
+ FROM ubuntu:24.04
3
+
4
+ ENV DEBIAN_FRONTEND=noninteractive
5
+ ENV TZ=Etc/UTC
6
+
7
+ # 安装必要工具
8
+ RUN apt-get update && apt-get install -y \
9
+ curl \
10
+ git \
11
+ wget \
12
+ build-essential \
13
+ python3 \
14
+ python3-pip \
15
+ python3-venv \
16
+ sudo \
17
+ jq \
18
+ openssl \
19
+ ca-certificates \
20
+ cron \
21
+ && rm -rf /var/lib/apt/lists/*
22
+
23
+ RUN ln -snf /usr/bin/python3 /usr/bin/python || true
24
+
25
+ # 安装 Node.js 22
26
+ RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
27
+ && apt-get install -y nodejs \
28
+ && npm -v
29
+
30
+ # 全局安装 openclaw
31
+ RUN npm install -g openclaw@latest
32
+
33
+ # 复制 entrypoint 脚本和相关文件
34
  COPY scripts/openclaw-entrypoint.sh /usr/local/bin/openclaw-entrypoint.sh
35
+ COPY scripts/openclaw-backup-cron.sh /usr/local/bin/openclaw-backup-cron.sh
36
+ COPY scripts/openclaw-restore.sh /usr/local/bin/openclaw-restore.sh
37
+ COPY scripts/openclaw-gateway-restart /usr/local/bin/openclaw-gateway-restart
38
+ RUN chmod +x /usr/local/bin/openclaw-*.sh
39
 
40
+ # 设置环境变量
41
  ENV PORT=7860
42
+ ENV OPENCLAW_GATEWAY_BIND=lan
43
+ ENV OPENCLAW_GATEWAY_PORT=7860
44
 
 
45
  EXPOSE 7860
46
 
47
+ WORKDIR /app
48
+
49
+ # 使用 entrypoint 脚本作为入口
50
  ENTRYPOINT ["/usr/local/bin/openclaw-entrypoint.sh"]
51
+
52
+ # 默认运行 gateway 子命令
53
  CMD ["gateway"]