openclaw-ai / Dockerfile
luoluoluo22's picture
Configure Feishu plugin
0d64ae6
# 核心镜像:Node 22 slim 保证了环境的现代性与轻量化
FROM node:22-slim
# 1. 安装系统依赖
# 包含:git (拉取依赖), openssh-client (解决构建报错), build-essential/g++/make (编译原生模块), python3 (运行同步脚本)
RUN apt-get update && apt-get install -y --no-install-recommends git openssh-client build-essential python3 python3-pip g++ make ca-certificates gettext\
&& rm -rf /var/lib/apt/lists/*
# 2. 安装 Hugging Face 命令行工具
RUN pip3 install --no-cache-dir huggingface_hub --break-system-packages
# 3. 构建环境优化
# 修复 Git 证书问题并将所有 SSH 协议重定向为 HTTPS
RUN update-ca-certificates &&\
git config --global http.sslVerify false && \
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
# 4. 全局安装 OpenClaw 及 Feishu 插件
RUN npm install -g openclaw@latest @openclaw/feishu --unsafe-perm
# 5. 设置环境变量
ENV PORT=7860\
OPENCLAW_GATEWAY_MODE=local\
HOME=/root
RUN mkdir /root/.openclaw/
COPY sync.py start-openclaw /usr/local/bin/
COPY openclaw.json.template /root/.openclaw/
COPY entrypoint.sh /
RUN chmod a+rx /usr/local/bin/start-openclaw && chmod a+rx /entrypoint.sh
EXPOSE 7860
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/local/bin/start-openclaw"]