syw1516 commited on
Commit
ba3990a
·
verified ·
1 Parent(s): b0f7a68

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -27
Dockerfile CHANGED
@@ -1,56 +1,48 @@
1
- # v=20260507c
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-venv \
15
  python3-pip \
16
  sudo \
17
  jq \
18
- openssl \
19
- ca-certificates \
20
- cron \
21
- dos2unix \
22
  && rm -rf /var/lib/apt/lists/*
23
 
 
 
24
  RUN ln -snf /usr/bin/python3 /usr/bin/python || true
25
 
26
- # 安装 Node.js 22
 
27
  RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
28
  && apt-get install -y nodejs \
29
  && npm -v
30
 
31
- # 安装 gosu(用于降权执行 gateway)
32
- RUN wget -O /usr/local/bin/gosu \
33
- https://github.com/tianon/gosu/releases/download/1.18/gosu-amd64 \
34
- && chmod +x /usr/local/bin/gosu
35
-
36
- # 全局安装 openclaw
37
  RUN npm install -g openclaw@latest
38
 
39
- # 复制 entrypoint 脚本(转换换行符)
40
- COPY scripts/openclaw-entrypoint.sh /tmp/openclaw-entrypoint.sh
41
- RUN dos2unix /tmp/openclaw-entrypoint.sh \
42
- && mv /tmp/openclaw-entrypoint.sh /usr/local/bin/openclaw-entrypoint.sh \
43
- && chmod +x /usr/local/bin/openclaw-entrypoint.sh
44
-
45
- # 设置环境变量
46
  ENV PORT=7860
47
- ENV OPENCLAW_GATEWAY_BIND=lan
48
- ENV OPENCLAW_GATEWAY_PORT=7860
49
 
50
  EXPOSE 7860
51
 
52
  WORKDIR /app
53
 
54
- # 使用 bash -c 执行 entrypoint 脚本
55
- ENTRYPOINT ["/bin/bash", "-c"]
56
- CMD ["/usr/local/bin/openclaw-entrypoint.sh gateway"]
 
 
 
 
 
 
 
1
+ FROM docker.io/library/ubuntu:24.04@sha256:c4a8d5503dfb2a3eb8ab5f807da5bc69a85730fb49b5cfca2330194ebcc41c7b
 
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV TZ=Etc/UTC
5
 
 
6
  RUN apt-get update && apt-get install -y \
7
  curl \
8
  git \
9
  wget \
10
+ vim \
11
+ openssh-client \
12
  build-essential \
13
  python3 \
 
14
  python3-pip \
15
  sudo \
16
  jq \
17
+ gosu \
 
 
 
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
+ RUN apt-get update && apt-get install -y dos2unix && rm -rf /var/lib/apt/lists/*
21
+
22
  RUN ln -snf /usr/bin/python3 /usr/bin/python || true
23
 
24
+ RUN pip3 install --break-system-packages huggingface_hub[cli] -q
25
+
26
  RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
27
  && apt-get install -y nodejs \
28
  && npm -v
29
 
 
 
 
 
 
 
30
  RUN npm install -g openclaw@latest
31
 
 
 
 
 
 
 
 
32
  ENV PORT=7860
33
+ ENV GATEWAY_PORT=7860
34
+ ENV GATEWAY_BIND=lan
35
 
36
  EXPOSE 7860
37
 
38
  WORKDIR /app
39
 
40
+ RUN openclaw install-gateway
41
+
42
+ COPY entrypoint.sh /entrypoint.sh
43
+ RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
44
+
45
+ COPY backup_restore.py /usr/local/bin/backup_restore.py
46
+ RUN chmod +x /usr/local/bin/backup_restore.py
47
+
48
+ ENTRYPOINT ["/entrypoint.sh"]