From 0a5b10608950cffbe6fe988d2b65acd7ad36587d Mon Sep 17 00:00:00 2001 From: Simon KP Date: Mon, 26 Jan 2026 20:16:43 +1100 Subject: [PATCH 1/4] fix: always deploy config from repo on startup --- Dockerfile.prod | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile.prod b/Dockerfile.prod index 8e5796a28..e19afc30a 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -55,11 +55,9 @@ RUN rm -rf node_modules && npm install --omit=dev # Create entrypoint script 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 "Deploying config from repo..."\n\ +mkdir -p /root/.clawdbot\n\ +cp /app/clawdbot.default.json /root/.clawdbot/clawdbot.json\n\ echo "Installing checkins plugin..."\n\ mkdir -p /root/.clawdbot/extensions\n\ cp -r /app/bundled-plugins/checkins /root/.clawdbot/extensions/\n\ From 9d8833e70aaedb7f3494516e961732084983566f Mon Sep 17 00:00:00 2001 From: Simon KP Date: Mon, 26 Jan 2026 20:19:19 +1100 Subject: [PATCH 2/4] fix: merge repo config with existing (repo takes precedence) --- Dockerfile.prod | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Dockerfile.prod b/Dockerfile.prod index e19afc30a..d2ba33b15 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -35,6 +35,9 @@ RUN npm install && npm run build # Stage 3: Production image FROM node:22-bookworm-slim +# Install jq for config merging +RUN apt-get update && apt-get install -y jq && rm -rf /var/lib/apt/lists/* + WORKDIR /app # Copy built clawdbot @@ -55,9 +58,15 @@ RUN rm -rf node_modules && npm install --omit=dev # Create entrypoint script RUN echo '#!/bin/sh\n\ -echo "Deploying config from repo..."\n\ mkdir -p /root/.clawdbot\n\ -cp /app/clawdbot.default.json /root/.clawdbot/clawdbot.json\n\ +if [ -f "/root/.clawdbot/clawdbot.json" ]; then\n\ + echo "Merging repo config with existing config..."\n\ + jq -s ".[0] * .[1]" /root/.clawdbot/clawdbot.json /app/clawdbot.default.json > /tmp/merged.json\n\ + mv /tmp/merged.json /root/.clawdbot/clawdbot.json\n\ +else\n\ + echo "Creating config from repo..."\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\ From ca000bc7fb2f6b6b8d946aa897527e834ee2417e Mon Sep 17 00:00:00 2001 From: Simon KP Date: Mon, 26 Jan 2026 20:23:27 +1100 Subject: [PATCH 3/4] fix: remove invalid plugin references from prod config --- deploy/prod/clawdbot.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/deploy/prod/clawdbot.json b/deploy/prod/clawdbot.json index 23eae9a4c..4733a6e73 100644 --- a/deploy/prod/clawdbot.json +++ b/deploy/prod/clawdbot.json @@ -76,12 +76,10 @@ }, "plugins": { "entries": { - "discord": { - "enabled": true - }, "checkins": { "enabled": true } - } + }, + "slots": {} } } From e77e36bbaa268d70cecef7f37fed290ffa5cef46 Mon Sep 17 00:00:00 2001 From: Simon KP Date: Mon, 26 Jan 2026 20:32:36 +1100 Subject: [PATCH 4/4] fix: bundle memory-core plugin alongside checkins --- Dockerfile.prod | 22 +++++++++++++++++----- deploy/prod/clawdbot.json | 7 ++++++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Dockerfile.prod b/Dockerfile.prod index d2ba33b15..feed831a3 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -23,7 +23,7 @@ RUN pnpm build # (Also avoids extensions/memory-core requiring unreleased clawdbot version) # Stage 2: Build checkins extension -FROM node:22-slim AS extension-builder +FROM node:22-slim AS checkins-builder RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* @@ -32,6 +32,16 @@ COPY extensions/checkins ./ RUN npm install && npm run build +# Stage 2b: Build memory-core extension +FROM node:22-slim AS memory-core-builder + +WORKDIR /build +COPY extensions/memory-core ./ + +# Add esbuild and build (skip peer deps to avoid unreleased clawdbot version) +RUN npm install --legacy-peer-deps esbuild && \ + npx esbuild index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --external:clawdbot --external:clawdbot/* + # Stage 3: Production image FROM node:22-bookworm-slim @@ -46,13 +56,14 @@ COPY --from=clawdbot-builder /app/node_modules ./node_modules COPY --from=clawdbot-builder /app/package.json ./package.json # UI not built - gateway-only deploy -# Copy the pre-built extension to staging (PVC will mount over /root/.clawdbot) -COPY --from=extension-builder /build /app/bundled-plugins/checkins +# Copy the pre-built extensions to staging (PVC will mount over /root/.clawdbot) +COPY --from=checkins-builder /build /app/bundled-plugins/checkins +COPY --from=memory-core-builder /build /app/bundled-plugins/memory-core # Copy default config COPY deploy/prod/clawdbot.json /app/clawdbot.default.json -# Install production dependencies for extension +# Install production dependencies for extensions WORKDIR /app/bundled-plugins/checkins RUN rm -rf node_modules && npm install --omit=dev @@ -67,9 +78,10 @@ else\n\ echo "Creating config from repo..."\n\ cp /app/clawdbot.default.json /root/.clawdbot/clawdbot.json\n\ fi\n\ -echo "Installing checkins plugin..."\n\ +echo "Installing plugins..."\n\ mkdir -p /root/.clawdbot/extensions\n\ cp -r /app/bundled-plugins/checkins /root/.clawdbot/extensions/\n\ +cp -r /app/bundled-plugins/memory-core /root/.clawdbot/extensions/\n\ exec node /app/dist/entry.js gateway run\n\ ' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh diff --git a/deploy/prod/clawdbot.json b/deploy/prod/clawdbot.json index 4733a6e73..80334f360 100644 --- a/deploy/prod/clawdbot.json +++ b/deploy/prod/clawdbot.json @@ -78,8 +78,13 @@ "entries": { "checkins": { "enabled": true + }, + "memory-core": { + "enabled": true } }, - "slots": {} + "slots": { + "memory": "memory-core" + } } }