Spaces:
Running
Running
Upload 2 files
Browse files- Dockerfile +5 -1
Dockerfile
CHANGED
|
@@ -30,10 +30,14 @@ ENV OPENCLAW_PREFER_PNPM=1
|
|
| 30 |
RUN pnpm ui:build
|
| 31 |
|
| 32 |
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
# Security hardening: Run as non-root user
|
| 35 |
# The node:22-bookworm image includes a 'node' user (uid 1000)
|
| 36 |
# This reduces the attack surface by preventing container escape via root privileges
|
| 37 |
USER node
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
| 30 |
RUN pnpm ui:build
|
| 31 |
|
| 32 |
ENV NODE_ENV=production
|
| 33 |
+
ENV OPENCLAW_SKIP_CHANNELS=1
|
| 34 |
+
ENV CLAWDBOT_SKIP_CHANNELS=1
|
| 35 |
+
ENV OPENCLAW_GATEWAY_BIND=lan
|
| 36 |
|
| 37 |
# Security hardening: Run as non-root user
|
| 38 |
# The node:22-bookworm image includes a 'node' user (uid 1000)
|
| 39 |
# This reduces the attack surface by preventing container escape via root privileges
|
| 40 |
USER node
|
| 41 |
|
| 42 |
+
EXPOSE 7860
|
| 43 |
+
CMD ["bash", "-lc", "if [ -z \"${OPENCLAW_GATEWAY_TOKEN:-}\" ]; then echo \"Missing OPENCLAW_GATEWAY_TOKEN. Set it in Hugging Face Space Secrets.\" >&2; exit 1; fi; STATE_DIR=\"${OPENCLAW_STATE_DIR:-/tmp/openclaw}\"; mkdir -p \"$STATE_DIR\"; export OPENCLAW_STATE_DIR=\"$STATE_DIR\"; PORT_VALUE=\"${PORT:-7860}\"; export OPENCLAW_GATEWAY_PORT=\"$PORT_VALUE\"; node openclaw.mjs gateway --allow-unconfigured --port \"$PORT_VALUE\" --bind \"${OPENCLAW_GATEWAY_BIND:-lan}\""]
|