| FROM node:22-slim | |
| LABEL description="OpenClaw AI Agent - Deployed on Hugging Face Spaces" | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl \ | |
| wget \ | |
| git \ | |
| jq \ | |
| ca-certificates \ | |
| openssl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install OpenClaw globally | |
| RUN npm install -g openclaw@latest | |
| # Pre-install Telegram plugin for OpenClaw | |
| RUN openclaw plugins install clawhub:@openclaw/telegram 2>/dev/null; echo "done" | |
| # Create working directory | |
| WORKDIR /app | |
| # Copy all application files | |
| COPY . /app/ | |
| # Make entrypoint executable | |
| RUN chmod +x /app/entrypoint.sh | |
| # Create state directory | |
| RUN mkdir -p /app/.openclaw | |
| # HF Spaces uses port 7860 | |
| ENV PORT=7860 | |
| ENV OPENCLAW_CONFIG_PATH=/app/openclaw.json | |
| ENV OPENCLAW_STATE_DIR=/app/.openclaw | |
| # Expose the HF required port | |
| EXPOSE 7860 | |
| # Start the application | |
| ENTRYPOINT ["/app/entrypoint.sh"] | |