File size: 1,588 Bytes
2ce5e59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40b6916
4a2d2b3
40b6916
 
 
2ce5e59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 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"]