Simford.Dong commited on
Commit
17b6773
·
1 Parent(s): bd717c9

feat: switch to nanoclaw image from GHCR

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -123
  2. README.md +8 -8
Dockerfile CHANGED
@@ -1,124 +1,5 @@
1
- FROM node:22-slim
 
2
 
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
5
-
6
- # Install OpenClaw globally
7
- RUN npm install -g openclaw@latest
8
-
9
- # Download and install Feishu plugin (only if not already present as an extension)
10
- RUN if [ ! -d "/usr/local/lib/node_modules/openclaw/extensions/feishu" ]; then \
11
- openclaw plugins install @m1heng-clawd/feishu; \
12
- fi
13
-
14
- # Create config directory in a writable location
15
- RUN mkdir -p /tmp/.openclaw && chmod 777 /tmp/.openclaw
16
-
17
- # Set up environment for Hugging Face Spaces
18
- ENV HOME=/tmp
19
- ENV PORT=7860
20
- ENV OPENCLAW_GATEWAY_MODE=local
21
- ENV OPENCLAW_GATEWAY_PASSWORD=${SETUP_PASSWORD}
22
- ENV FEISHU_DM_POLICY=open
23
-
24
- # Expose the port (Hugging Face default)
25
- EXPOSE 7860
26
-
27
- # Create a startup script that generates config and starts OpenClaw
28
- RUN printf '#!/bin/bash\n\
29
- set -x\n\
30
- \n\
31
- # Use /tmp/.openclaw as the config home\n\
32
- export OPENCLAW_HOME="/tmp/.openclaw"\n\
33
- mkdir -p "$OPENCLAW_HOME/agents/main/agent"\n\
34
- mkdir -p "$OPENCLAW_HOME/agents/main/sessions"\n\
35
- mkdir -p "$OPENCLAW_HOME/credentials"\n\
36
- \n\
37
- # Check for required environment variables\n\
38
- if [ -z "$ANTHROPIC_AUTH_TOKEN" ]; then\n\
39
- echo "ERROR: ANTHROPIC_AUTH_TOKEN is not set. Agent will fail. Exiting."\n\
40
- exit 1\n\
41
- fi\n\
42
- \n\
43
- # Run doctor --fix BEFORE writing our custom config to ensure it doesn'\''t revert our changes\n\
44
- openclaw doctor --fix\n\
45
- \n\
46
- # Always ensure we have a clean config with required values\n\
47
- cat > "$OPENCLAW_HOME/openclaw.json" << EOF\n\
48
- {\n\
49
- "env": {\n\
50
- "ANTHROPIC_AUTH_TOKEN": "${ANTHROPIC_AUTH_TOKEN}",\n\
51
- "ANTHROPIC_BASE_URL": "${ANTHROPIC_BASE_URL}",\n\
52
- "ANTHROPIC_MODEL": "${ANTHROPIC_MODEL}",\n\
53
- "OPENAI_API_KEY": "${ANTHROPIC_AUTH_TOKEN}",\n\
54
- "OPENAI_BASE_URL": "${ANTHROPIC_BASE_URL}",\n\
55
- "FEISHU_APP_ID": "${FEISHU_APP_ID}",\n\
56
- "FEISHU_APP_SECRET": "${FEISHU_APP_SECRET}",\n\
57
- "FEISHU_ENCRYPT_KEY": "${FEISHU_ENCRYPT_KEY}",\n\
58
- "FEISHU_VERIFICATION_TOKEN": "${FEISHU_VERIFICATION_TOKEN}"\n\
59
- },\n\
60
- "gateway": {\n\
61
- "mode": "local",\n\
62
- "bind": "lan",\n\
63
- "port": 7860,\n\
64
- "trustedProxies": ["0.0.0.0/0"],\n\
65
- "auth": {\n\
66
- "mode": "token",\n\
67
- "token": "${SETUP_PASSWORD}"\n\
68
- },\n\
69
- "controlUi": {\n\
70
- "allowInsecureAuth": true\n\
71
- }\n\
72
- },\n\
73
- "channels": {\n\
74
- "feishu": {\n\
75
- "enabled": true,\n\
76
- "appId": "${FEISHU_APP_ID}",\n\
77
- "appSecret": "${FEISHU_APP_SECRET}",\n\
78
- "connectionMode": "websocket",\n\
79
- "domain": "feishu",\n\
80
- "dmPolicy": "open",\n\
81
- "groupPolicy": "open",\n\
82
- "requireMention": false,\n\
83
- "allowlist": ["ou_ab4e6560a7d593557f50a23f0e5ae137"],\n\
84
- "autoPairing": {\n\
85
- "ou_ab4e6560a7d593557f50a23f0e5ae137": "main"\n\
86
- }\n\
87
- }\n\
88
- },\n\
89
- "models": {\n\
90
- "providers": {\n\
91
- "openai": {\n\
92
- "baseUrl": "${ANTHROPIC_BASE_URL}",\n\
93
- "apiKey": "${ANTHROPIC_AUTH_TOKEN}",\n\
94
- "models": [\n\
95
- {\n\
96
- "id": "${ANTHROPIC_MODEL:-glm-4.7}",\n\
97
- "name": "GLM 4.7",\n\
98
- "contextWindow": 128000\n\
99
- }\n\
100
- ]\n\
101
- }\n\
102
- }\n\
103
- },\n\
104
- "agents": {\n\
105
- "defaults": {\n\
106
- "model": {\n\
107
- "primary": "openai/${ANTHROPIC_MODEL:-glm-4.7}"\n\
108
- },\n\
109
- "models": {\n\
110
- "openai/${ANTHROPIC_MODEL:-glm-4.7}": {}\n\
111
- }\n\
112
- }\n\
113
- }\n\
114
- }\n\
115
- EOF\n\
116
- \n\
117
- # Debug: show config\n\
118
- cat "$OPENCLAW_HOME/openclaw.json"\n\
119
- \n\
120
- # Start OpenClaw gateway\n\
121
- echo "Starting OpenClaw gateway on port 7860..."\n\
122
- exec openclaw gateway run --port 7860 --allow-unconfigured\n' > /usr/local/bin/start-openclaw && chmod +x /usr/local/bin/start-openclaw
123
-
124
- CMD ["/usr/local/bin/start-openclaw"]
 
1
+ # Use the custom Nanoclaw image
2
+ FROM ghcr.io/sim4d/nanoclaw:latest
3
 
4
+ # Environment variables are passed by Hugging Face Spaces automatically
5
+ # The image already exposes port 7860 and starts the Feishu bot
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,19 +1,19 @@
1
  ---
2
- title: OpenClaw AI Assistant
3
- emoji: 🦞
4
- colorFrom: pink
5
- colorTo: yellow
6
  sdk: docker
7
  pinned: false
8
  license: mit
9
- short_description: Your own personal AI assistant
10
  ---
11
 
12
- # OpenClaw AI Assistant
13
 
14
- > Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞
15
 
16
- This Hugging Face Space runs the full **OpenClaw** gateway with Control UI and WebChat support.
17
 
18
  ## Features
19
 
 
1
  ---
2
+ title: NanoClaw AI Assistant
3
+ emoji: 🦀
4
+ colorFrom: blue
5
+ colorTo: purple
6
  sdk: docker
7
  pinned: false
8
  license: mit
9
+ short_description: Lightweight, secure, customizable AI assistant
10
  ---
11
 
12
+ # NanoClaw AI Assistant
13
 
14
+ > Your own personal AI assistant. Powered by Nanoclaw. 🦀
15
 
16
+ This Hugging Face Space runs **NanoClaw**, a lightweight alternative to OpenClaw optimized for performance and security.
17
 
18
  ## Features
19