FROM node:22-bookworm WORKDIR /app # Enable modern package managers (optional but harmless) RUN corepack enable # Install Clawdbot CLI (includes Gateway + Web UI) RUN npm install -g clawdbot@latest \ && mkdir -p /data/config /data/workspace /data/state # Runtime directories for config and state ENV CLAWDBOT_CONFIG_DIR=/data/config ENV CLAWDBOT_WORKSPACE_DIR=/data/workspace ENV CLAWDBOT_STATE_DIR=/data/state # Default environment (Hugging Face Spaces overrides PORT) ENV NODE_ENV=production ENV PORT=7860 # Clawdbot honors CLAWBOT_GATEWAY_PORT for the Gateway HTTP/WebSocket port ENV CLAWBOT_GATEWAY_PORT=${PORT} # Expose HTTP port for Spaces / local Docker EXPOSE 7860 # Start Gateway bound to LAN, using PORT (or 7860) and allowing first-run # without a prewritten config file. Auth/token should be configured via # env vars or config once the Space is up. CMD ["sh", "-c", "export CLAWBOT_GATEWAY_PORT=${PORT:-7860}; clawdbot gateway --bind lan --port ${PORT:-7860} --allow-unconfigured --verbose"]