From 137f534d6db2054a2186041983a18334fd23d236 Mon Sep 17 00:00:00 2001 From: Simon KP Date: Mon, 26 Jan 2026 19:26:21 +1100 Subject: [PATCH] fix: restore Dockerfile.prod and deploy config lost during fork sync --- Dockerfile.prod | 41 +++++++++++++++++ deploy/prod/.dockerignore | 46 +++++++++++++++++++ deploy/prod/clawdbot.json | 87 +++++++++++++++++++++++++++++++++++ deploy/prod/values.yaml | 96 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 270 insertions(+) create mode 100644 Dockerfile.prod create mode 100644 deploy/prod/.dockerignore create mode 100644 deploy/prod/clawdbot.json create mode 100644 deploy/prod/values.yaml diff --git a/Dockerfile.prod b/Dockerfile.prod new file mode 100644 index 000000000..d26f48a27 --- /dev/null +++ b/Dockerfile.prod @@ -0,0 +1,41 @@ +# Stage 1: Build extension +FROM node:22-slim AS builder + +# Install git (needed by npm for some deps) +RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* + +WORKDIR /build +COPY extensions/checkins ./ + +# Install all deps (including devDependencies for tsc) and build +RUN npm install && npm run build + +# Stage 2: Production image +FROM ghcr.io/clawdbot/clawdbot:main + +# Copy the pre-built extension to staging (PVC will mount over /root/.clawdbot) +COPY --from=builder /build /app/bundled-plugins/checkins + +# Copy default config +COPY deploy/prod/clawdbot.json /app/clawdbot.default.json + +# Install production dependencies in staging +WORKDIR /app/bundled-plugins/checkins +RUN rm -rf node_modules && npm install --omit=dev + +# Create entrypoint script - copies plugin from staging to plugins dir at runtime +RUN echo '#!/bin/sh\n\ +if [ ! -f "/root/.clawdbot/clawdbot.json" ]; then\n\ + echo "Creating default config..."\n\ + mkdir -p /root/.clawdbot\n\ + cp /app/clawdbot.default.json /root/.clawdbot/clawdbot.json\n\ +fi\n\ +echo "Installing checkins plugin..."\n\ +mkdir -p /root/.clawdbot/extensions\n\ +cp -r /app/bundled-plugins/checkins /root/.clawdbot/extensions/\n\ +exec node /app/dist/entry.js gateway run\n\ +' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh + +WORKDIR /root/.clawdbot + +ENTRYPOINT ["/bin/sh", "/app/entrypoint.sh"] diff --git a/deploy/prod/.dockerignore b/deploy/prod/.dockerignore new file mode 100644 index 000000000..ea2b8733c --- /dev/null +++ b/deploy/prod/.dockerignore @@ -0,0 +1,46 @@ +.git +.worktrees +.bun-cache +.bun +.tmp +**/.tmp +.DS_Store +**/.DS_Store +*.png +*.jpg +*.jpeg +*.webp +*.gif +*.mp4 +*.mov +*.wav +*.mp3 +node_modules +**/node_modules +.pnpm-store +**/.pnpm-store +.turbo +**/.turbo +.cache +**/.cache +.next +**/.next +coverage +**/coverage +*.log +tmp +**/tmp + +# build artifacts - KEEP dist for prod build +apps/macos/.build +apps/ios/build +**/*.trace + +# large app trees not needed for CLI build +apps/ +assets/ +Peekaboo/ +Swabble/ +Core/ +Users/ +vendor/ diff --git a/deploy/prod/clawdbot.json b/deploy/prod/clawdbot.json new file mode 100644 index 000000000..23eae9a4c --- /dev/null +++ b/deploy/prod/clawdbot.json @@ -0,0 +1,87 @@ +{ + "gateway": { + "mode": "local" + }, + "agents": { + "list": [ + { + "id": "main", + "identity": { + "name": "tobais", + "emoji": "🤖" + } + } + ], + "defaults": { + "model": { + "primary": "anthropic/claude-sonnet-4-20250514" + }, + "thinkingDefault": "off", + "timeoutSeconds": 300, + "maxConcurrent": 2 + } + }, + "channels": { + "discord": { + "enabled": true, + "groupPolicy": "allowlist", + "dm": { + "enabled": true, + "policy": "allowlist", + "allowFrom": ["213199879525105664"] + }, + "guilds": { + "884603707658997780": { + "slug": "techops", + "requireMention": true, + "channels": { + "1437982793564160070": { + "allow": true, + "requireMention": false + }, + "1461818628424073309": { + "allow": true, + "requireMention": false + }, + "907225024753180672": { + "allow": true, + "requireMention": true + } + } + } + } + } + }, + "session": { + "scope": "per-sender", + "dmScope": "per-channel-peer", + "reset": { + "mode": "idle", + "idleMinutes": 60 + }, + "resetTriggers": ["/new", "/reset"] + }, + "messages": { + "ackReaction": "👀", + "inbound": { + "debounceMs": 2000 + } + }, + "skills": { + "allowBundled": ["self-improving-agent", "github"] + }, + "logging": { + "level": "info", + "consoleStyle": "compact" + }, + "plugins": { + "entries": { + "discord": { + "enabled": true + }, + "checkins": { + "enabled": true + } + } + } +} diff --git a/deploy/prod/values.yaml b/deploy/prod/values.yaml new file mode 100644 index 000000000..d100c9725 --- /dev/null +++ b/deploy/prod/values.yaml @@ -0,0 +1,96 @@ +replicaCount: 1 # Single replica - SQLite doesn't support multiple writers + +service: + enabled: false # No HTTP service needed - Discord bot uses WebSocket + tls: + enabled: false + +ingress: + enabled: false # No ingress - Discord bot + +image: + repository: ${ECR_REGISTRY}/clawdbot + tag: ${IMAGE_TAG} + pullPolicy: Always + +deployment: + enabled: true + volumes: + - name: clawdbot-data + mountPath: /root/.clawdbot + provisioner: ebs.csi.aws.com + bindingMode: WaitForFirstConsumer + accessModes: + - ReadWriteOnce + parameters: + type: gp3 + reclaimPolicy: Retain + resources: + requests: + storage: 10Gi + +serviceAccount: + create: false + +podAnnotations: + reloader.stakater.com/auto: "true" + +podSecurityContext: + fsGroup: 0 + +securityContext: + runAsNonRoot: false + runAsUser: 0 + +resources: + limits: + memory: 2Gi + requests: + cpu: 10m + memory: 512Mi + +# Minimal probes - chart requires valid probe config even when not needed +# Using exec with 'true' command as no-op since Discord bot has no HTTP endpoint +livenessProbe: + exec: + command: ["true"] + initialDelaySeconds: 10 + periodSeconds: 60 + +readinessProbe: + exec: + command: ["true"] + initialDelaySeconds: 5 + periodSeconds: 60 + +# Persistent storage for SQLite database +persistence: + enabled: true + storageClass: gp3 + accessMode: ReadWriteOnce + size: 10Gi + mountPath: /root/.clawdbot + +env: + NODE_ENV: + type: kv + value: "production" + # Discord bot token from SSM + DISCORD_BOT_TOKEN: + type: parameterStore + name: discord-bot-token + parameter_name: /eks/maker-prod/clawdbot/discord-bot-token + # Anthropic API key from SSM + ANTHROPIC_API_KEY: + type: parameterStore + name: anthropic-api-key + parameter_name: /eks/maker-prod/clawdbot/anthropic-api-key + +externalSecrets: + clusterSecretStoreName: maker-prod + +nodeSelector: {} + +tolerations: [] + +affinity: {}