diff --git a/Dockerfile b/Dockerfile index 16c4f79..c9cabd2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,10 @@ COPY --from=builder /app/.next/static ./.next/static COPY --from=deps /app/node_modules/better-sqlite3 ./node_modules/better-sqlite3 COPY --from=deps /app/node_modules/sharp ./node_modules/sharp COPY --from=deps /app/node_modules/@img ./node_modules/@img +# tesseract.js loads its worker via worker_threads using a runtime-constructed path, +# so the standalone file tracer never discovers src/worker-script/node/. Copy the +# full package so that path resolves correctly at runtime. +COPY --from=deps /app/node_modules/tesseract.js ./node_modules/tesseract.js # Create thumbnail cache directory (mounted as a volume in production) RUN mkdir -p /app/.thumbnails diff --git a/next.config.ts b/next.config.ts index 3777626..072400c 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,7 +2,7 @@ import type { NextConfig } from 'next' const nextConfig: NextConfig = { output: 'standalone', - serverExternalPackages: ['better-sqlite3', 'sharp'], + serverExternalPackages: ['better-sqlite3', 'sharp', 'tesseract.js'], } export default nextConfig