From cb7ce7f229eacaf1a0af3e24165c56349369b802 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 17 Jun 2026 15:04:29 +0200 Subject: [PATCH] fix(docker): ship the encryption-key migration script in the image The production image only copied server/dist, so the documented rotation command `node --import tsx scripts/migrate-encryption.ts` failed inside the container with a module-not-found error - the raw .ts was never present. The script runs via tsx straight from source and only pulls node builtins plus better-sqlite3 (both prod deps), so copying the single file into /app/server/scripts is enough to make the rotation work again. --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index d6463fd7..e6e8f1a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -85,6 +85,10 @@ COPY --from=server-builder /app/server/dist ./server/dist COPY --from=server-builder /app/server/assets ./server/assets # tsconfig-paths/register reads this at runtime to resolve MCP SDK paths. COPY server/tsconfig.json ./server/ +# Encryption-key rotation is run on demand via tsx (a prod dep) straight from the +# raw .ts source — it never enters dist, so it must be copied in explicitly or +# `node --import tsx scripts/migrate-encryption.ts` fails with module-not-found. +COPY server/scripts/migrate-encryption.ts ./server/scripts/migrate-encryption.ts COPY --from=shared-builder /app/shared/dist ./shared/dist COPY --from=client-builder /app/client/dist ./server/public COPY --from=client-builder /app/client/public/fonts ./server/public/fonts