ubix commited on
Commit
07431f1
·
verified ·
1 Parent(s): 49fa441

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -3
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  # OpenClaw Gateway for Hugging Face Spaces
2
- # Build context: your Space repo (this Dockerfile + README). OpenClaw is cloned during build.
 
3
 
4
  FROM node:22-bookworm
5
 
@@ -25,6 +26,10 @@ RUN git clone --depth 1 --branch "${OPENCLAW_REF}" "${OPENCLAW_REPO}" . \
25
  ENV OPENCLAW_PREFER_PNPM=1
26
  RUN pnpm ui:build
27
 
 
 
 
 
28
  ENV NODE_ENV=production
29
 
30
  # Spaces expose a single port (default 7860); gateway must listen on 0.0.0.0
@@ -45,11 +50,20 @@ RUN printf '%s\n' \
45
  > /app/entrypoint.sh \
46
  && chmod +x /app/entrypoint.sh
47
 
48
- # HF Spaces Dev Mode injects steps that expect /home/user; create it so they don't fail with "Permission denied"
49
  RUN chown -R node:node /app \
50
  && mkdir -p /home/user \
51
  && chown -R node:node /home/user
52
  USER node
53
 
54
- # Token/password: set OPENCLAW_GATEWAY_TOKEN or OPENCLAW_GATEWAY_PASSWORD in Space Secrets
 
 
 
 
 
 
 
 
 
55
  ENTRYPOINT ["/app/entrypoint.sh"]
 
1
  # OpenClaw Gateway for Hugging Face Spaces
2
+ # Build context: your Space repo (this Dockerfile + README + setup-hf-config.mjs).
3
+ # OpenClaw is cloned during build; setup-hf-config.mjs is overridden by your Space repo copy.
4
 
5
  FROM node:22-bookworm
6
 
 
26
  ENV OPENCLAW_PREFER_PNPM=1
27
  RUN pnpm ui:build
28
 
29
+ # Override the HF setup script with the customized version from Space repo
30
+ # This adds OpenRouter/Perplexity support on top of the default HF config
31
+ COPY setup-hf-config.mjs /app/spaces/huggingface/setup-hf-config.mjs
32
+
33
  ENV NODE_ENV=production
34
 
35
  # Spaces expose a single port (default 7860); gateway must listen on 0.0.0.0
 
50
  > /app/entrypoint.sh \
51
  && chmod +x /app/entrypoint.sh
52
 
53
+ # HF Spaces Dev Mode injects steps that expect /home/user; create it so they don't fail
54
  RUN chown -R node:node /app \
55
  && mkdir -p /home/user \
56
  && chown -R node:node /home/user
57
  USER node
58
 
59
+ # Required Secrets in HF Space Settings:
60
+ # OPENCLAW_GATEWAY_TOKEN — long random string for Control UI login (recommended)
61
+ # OPENCLAW_GATEWAY_PASSWORD — alternative to token (token wins if both set)
62
+ # HF_TOKEN — Hugging Face token with Inference Providers permission
63
+ # OPENROUTER_API_KEY — OpenRouter API key for Perplexity Sonar search model
64
+ #
65
+ # Optional Secrets/Variables:
66
+ # OPENCLAW_HF_DEFAULT_MODEL — e.g. huggingface/deepseek-ai/DeepSeek-R1 (default)
67
+ # OPENCLAW_GATEWAY_TRUSTED_PROXIES — comma-separated proxy IPs
68
+ # OPENCLAW_CONTROL_UI_ALLOWED_ORIGINS — comma-separated allowed origins
69
  ENTRYPOINT ["/app/entrypoint.sh"]