/ docker / Dockerfile.claw
Dockerfile.claw
 1  # PraisonAI 🦞 Claw — All-in-one: dashboard + bots + gateway + agents
 2  #
 3  # Build:    docker build -f docker/Dockerfile.claw -t praisonai:claw ..
 4  # Run:      docker run -p 8082:8082 -e OPENAI_API_KEY=sk-xxx praisonai:claw
 5  # Health:   curl http://localhost:8082/health
 6  #
 7  # Override CMD for other modes:
 8  #   Bot:     docker run -e ... praisonai:claw praisonai bot telegram
 9  #   Gateway: docker run -e ... praisonai:claw praisonai gateway start
10  #   Serve:   docker run -e ... praisonai:claw praisonai serve agents.yaml
11  #   Shell:   docker run --rm -it praisonai:claw bash
12  
13  FROM python:3.12-slim AS base
14  
15  # ── Environment ──────────────────────────────────────────────────────────────
16  ENV PYTHONDONTWRITEBYTECODE=1 \
17      PYTHONUNBUFFERED=1 \
18      AIUI_PORT=8082 \
19      AIUI_HOST=0.0.0.0 \
20      AIUI_DATA_DIR=/data
21  
22  WORKDIR /app
23  
24  # ── System dependencies ─────────────────────────────────────────────────────
25  # tini:            PID 1 signal handling (graceful shutdown on Fly/Railway/k8s)
26  # curl:            HEALTHCHECK probe
27  # build-essential: compile native Python wheels (chromadb, etc.)
28  RUN apt-get update && apt-get install -y --no-install-recommends \
29      tini \
30      curl \
31      build-essential \
32      && rm -rf /var/lib/apt/lists/*
33  
34  # ── Install PraisonAI 🦞 ────────────────────────────────────────────────────
35  # Single command installs: AIUI dashboard, agents SDK (memory/knowledge/llm/mcp),
36  # bot channels (Telegram/Discord/Slack), gateway, search tools, and more.
37  RUN pip install --no-cache-dir "praisonai[claw]"
38  
39  # ── Data volume ──────────────────────────────────────────────────────────────
40  # Persistence for sessions, config, memory, knowledge stores
41  RUN mkdir -p /data
42  VOLUME /data
43  
44  # ── Entrypoint ───────────────────────────────────────────────────────────────
45  # Ensures /data exists and forwards all signals via tini
46  RUN printf '#!/bin/sh\n\
47      set -e\n\
48      mkdir -p /data 2>/dev/null || true\n\
49      exec "$@"\n' > /usr/local/bin/entrypoint.sh \
50      && chmod +x /usr/local/bin/entrypoint.sh
51  
52  EXPOSE 8082
53  
54  # ── Health check ─────────────────────────────────────────────────────────────
55  HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
56      CMD curl -f http://localhost:8082/health || exit 1
57  
58  # ── Run ──────────────────────────────────────────────────────────────────────
59  # Default: AIUI dashboard via praisonai claw. Override CMD for bot/gateway/serve.
60  ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"]
61  CMD ["praisonai", "claw", "--port", "8082"]