# OpenClaw for HuggingFace Spaces (fixed 2026.9.7, node 24) FROM node:24-slim RUN apt-get update && apt-get install -y \ ca-certificates curl netcat-openbsd git python3 make g++ \ --no-install-recommends && \ rm -rf /var/lib/apt/lists/* RUN git config --global url."https://github.com/".insteadOf ssh://git@github.com/ && \ git config --global url."https://github.com/".insteadOf git@github.com: ARG OPENCLAW_VERSION=2026.9.7 RUN npm config set fetch-retries 5 && \ npm config set fetch-retry-mintimeout 20000 && \ npm install -g openclaw@${OPENCLAW_VERSION} --no-audit --no-fund RUN mkdir -p /app/spaces/huggingface /home/user && chmod 777 /home/user COPY openclaw.json /app/openclaw-template.json COPY setup-hf-config.mjs /app/spaces/huggingface/setup-hf-config.mjs COPY entrypoint.sh /app/entrypoint.sh COPY security-check.sh /app/security-check.sh COPY tg-net-fix.cjs /app/tg-net-fix.cjs RUN chmod +x /app/entrypoint.sh /app/security-check.sh USER root EXPOSE 7860 ENTRYPOINT ["/app/entrypoint.sh"]