# 使用汉化版基础镜像 FROM 1186258278/openclaw-zh:latest USER root ENV TZ=Asia/Shanghai ENV PLAYWRIGHT_BROWSERS_PATH=/root/.openclaw/browsers # 安装基础工具与多服务运行组件 RUN (apt-get update && apt-get install -y curl tar jq nginx git chromium && rm -rf /var/lib/apt/lists/*) || \ (apk add --no-cache curl tar jq nginx git chromium) # 安装进程管理器 RUN npm install -g pm2 --unsafe-perm # 安装 code-server(官方安装脚本比 npm 全局安装更稳定) RUN curl -fsSL https://code-server.dev/install.sh | sh WORKDIR /app # 创建数据目录 RUN mkdir -p /root/.openclaw/workspace && \ mkdir -p /root/.openclaw/browsers && \ chmod -R 755 /root/.openclaw # 复制启动脚本 COPY run.sh /app/run.sh RUN chmod +x /app/run.sh # 暴露端口 EXPOSE 7860 HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=5 \ CMD curl -fsS http://127.0.0.1:7860/ >/dev/null || exit 1 # 启动 CMD ["/app/run.sh"]