Merge pull request #23 from techops-services/fix/restore-deploy-files

fix: restore Dockerfile.prod and deploy config
This commit is contained in:
Simon KP 2026-01-26 19:27:25 +11:00 committed by GitHub
commit 68a82225d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 270 additions and 0 deletions

41
Dockerfile.prod Normal file
View File

@ -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"]

46
deploy/prod/.dockerignore Normal file
View File

@ -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/

87
deploy/prod/clawdbot.json Normal file
View File

@ -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
}
}
}
}

96
deploy/prod/values.yaml Normal file
View File

@ -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: {}