a8926764 commited on
Commit
e50d600
·
verified ·
1 Parent(s): 42eda82

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -13
Dockerfile CHANGED
@@ -69,27 +69,27 @@
69
 
70
  # CMD ["/usr/local/bin/start-openclaw"]
71
 
72
- # 使用官方 Node.js 镜像
73
  FROM node:22-slim
74
 
75
- # 安装系统依赖(包括 Git、Python 等)
76
  RUN apt-get update && apt-get install -y --no-install-recommends \
77
- git openssh-client python3 python3-pip && \
78
- rm -rf /var/lib/apt/lists/*
 
79
 
80
- # 安装 Hugging Face CLI 工具,用于数据同步
 
 
 
 
81
  RUN pip3 install --no-cache-dir huggingface_hub
82
 
83
- # 全局安装 OpenClaw
84
  RUN npm install -g openclaw@latest
85
 
86
- # 设置环境变量
87
- ENV PORT=7860
88
-
89
- # 将同步脚本复制到容器中
90
- COPY sync.py /usr/local/bin/
91
  COPY start-openclaw.sh /usr/local/bin/
92
-
93
- # 设置启动脚本权限并声明启动命令
94
  RUN chmod +x /usr/local/bin/start-openclaw.sh
 
95
  CMD ["/usr/local/bin/start-openclaw.sh"]
 
69
 
70
  # CMD ["/usr/local/bin/start-openclaw"]
71
 
72
+ # 使用官方的Python基础镜像,或包含python3的镜像(如node:22-slim)
73
  FROM node:22-slim
74
 
75
+ # 安装Python和虚拟环境所需的包
76
  RUN apt-get update && apt-get install -y --no-install-recommends \
77
+ python3 \
78
+ python3-venv \
79
+ && rm -rf /var/lib/apt/lists/*
80
 
81
+ # 创建虚拟环境
82
+ RUN python3 -m venv /opt/venv
83
+
84
+ # 使用虚拟环境中的pip来安装包,确保后续命令使用虚拟环境中的Python
85
+ ENV PATH="/opt/venv/bin:$PATH"
86
  RUN pip3 install --no-cache-dir huggingface_hub
87
 
88
+ # ... 后续的安装OpenClaw等命令
89
  RUN npm install -g openclaw@latest
90
 
91
+ # ... 复制您的脚本等后续操作
 
 
 
 
92
  COPY start-openclaw.sh /usr/local/bin/
 
 
93
  RUN chmod +x /usr/local/bin/start-openclaw.sh
94
+
95
  CMD ["/usr/local/bin/start-openclaw.sh"]