Update Dockerfile
Browse files- Dockerfile +45 -36
Dockerfile
CHANGED
|
@@ -1,44 +1,53 @@
|
|
| 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 |
COPY scripts/openclaw-entrypoint.sh /usr/local/bin/openclaw-entrypoint.sh
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
-
#
|
| 36 |
ENV PORT=7860
|
| 37 |
-
ENV
|
|
|
|
| 38 |
|
| 39 |
-
# 9. Expose port
|
| 40 |
EXPOSE 7860
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
| 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"]
|