claw-template / Dockerfile
airsltd's picture
update
4a2d2b3
# OpenClaw Gateway for Hugging Face Spaces
# Supports Chinese channels: QQ, Enterprise WeChat, DingTalk, Feishu
FROM node:22-slim
# Install system dependencies (ca-certificates for HTTPS SSL)
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl \
git \
openssh-client \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates
# Configure git to use HTTPS instead of SSH for GitHub
RUN git config --global url."https://github.com/".insteadOf "git@github.com:" && \
git config --global url."https://github.com/".insteadOf "ssh://git@github.com/"
# Install OpenClaw globally
RUN npm install -g openclaw@latest
WORKDIR /app
# Copy .openclaw 目录结构
COPY ./.openclaw.example /home/node/.openclaw
# COPY ./.openclaw.example/openclaw.json /home/node/.openclaw/openclaw.json
# RUN mkdir -p /home/node/.openclaw/workspace
# Install Chinese channel plugins (QQ, Enterprise WeChat, DingTalk, Feishu)
# These are optional - if they fail, the gateway still works
RUN openclaw plugins install @openclawcity/dingtalk 2>/dev/null || true && \
openclaw plugins install @openclawcity/qq 2>/dev/null || true && \
openclaw plugins install @openclawcity/wecom 2>/dev/null || true && \
openclaw plugins install @openclawcity/feishu 2>/dev/null || true
# Fix permissions for HF Spaces (run as node user, UID 1000)
RUN chown -R node:node /app /home/node
USER node
# Default port (compatible with HF Spaces standard)
EXPOSE 7860
CMD ["openclaw", "gateway"]