Spaces:
Running
Running
| # Using Node 22 Bookworm | |
| FROM node:22-bookworm | |
| # 1. Install build dependencies as root | |
| USER root | |
| RUN apt-get update && apt-get install -y \ | |
| cmake \ | |
| build-essential \ | |
| python3 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Use existing 'node' user | |
| RUN mkdir -p /home/node/app /home/node/.openclaw && \ | |
| chown -R node:node /home/node/app /home/node/.openclaw | |
| # 3. Switch to the 'node' user | |
| USER node | |
| ENV HOME=/home/node \ | |
| PATH=/home/node/.local/bin:$PATH \ | |
| OPENCLAW_CONFIG_PATH=/home/node/.openclaw/openclaw.json | |
| WORKDIR /home/node/app | |
| # 4. Create the config file (Added your domains to be safe) | |
| RUN echo '{"gateway": {"trustedProxies": ["10.0.0.0/8"], "controlUi": {"allowedOrigins": ["https://huggingface.co", "https://ewssbd-sami-openclaw.hf.space", "https://oc.samiulfaysal.com.es", "https://ocui.pages.dev"], "allowInsecureAuth": true, "dangerouslyDisableDeviceAuth": true}}}' > /home/node/.openclaw/openclaw.json | |
| # 5. Install OpenClaw locally | |
| RUN npm install openclaw@latest | |
| # 6. Expose and Start (Clean startup command) | |
| EXPOSE 7860 | |
| CMD ["npx", "openclaw", "gateway", "--port", "7860", "--bind", "lan", "--allow-unconfigured", "--token", "Faysal25524"] |