fix: replace config from repo instead of merging

This commit is contained in:
Simon KP 2026-01-26 20:52:25 +11:00
parent fe48692ce6
commit d13163f5cf

View File

@ -45,9 +45,6 @@ RUN npm install --legacy-peer-deps esbuild && \
# Stage 3: Production image # Stage 3: Production image
FROM node:22-bookworm-slim 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 WORKDIR /app
# Copy built clawdbot # Copy built clawdbot
@ -70,14 +67,8 @@ RUN rm -rf node_modules && npm install --omit=dev
# Create entrypoint script # Create entrypoint script
RUN echo '#!/bin/sh\n\ RUN echo '#!/bin/sh\n\
mkdir -p /root/.clawdbot\n\ mkdir -p /root/.clawdbot\n\
if [ -f "/root/.clawdbot/clawdbot.json" ]; then\n\ echo "Deploying config from repo..."\n\
echo "Merging repo config with existing config..."\n\ cp /app/clawdbot.default.json /root/.clawdbot/clawdbot.json\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 plugins..."\n\ echo "Installing plugins..."\n\
mkdir -p /root/.clawdbot/extensions\n\ mkdir -p /root/.clawdbot/extensions\n\
cp -r /app/bundled-plugins/checkins /root/.clawdbot/extensions/\n\ cp -r /app/bundled-plugins/checkins /root/.clawdbot/extensions/\n\