From ffaf075369b88b8081e77eaedfb76e39b5e45a65 Mon Sep 17 00:00:00 2001 From: Shivam Patel Date: Mon, 9 Feb 2026 01:07:29 -0500 Subject: [PATCH] Copy sqlite/sqlite3 node_modules for monitor.js in Docker image The standalone output only includes modules Next.js traces for its own routes. sqlite gets webpack-bundled so it's not in node_modules/ for monitor.js to require(). Explicitly copy both packages from the builder. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 044425a..9e5fd02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,8 +47,10 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static # Create data directory for SQLite RUN mkdir -p /app/data && chown nextjs:nodejs /app/data -# Copy monitor script and startup script +# Copy monitor script and its dependencies (not traced by Next.js standalone output) COPY --from=builder --chown=nextjs:nodejs /app/monitor.js ./ +COPY --from=builder --chown=nextjs:nodejs /app/node_modules/sqlite ./node_modules/sqlite +COPY --from=builder --chown=nextjs:nodejs /app/node_modules/sqlite3 ./node_modules/sqlite3 COPY --chown=nextjs:nodejs start.sh ./ RUN chmod +x start.sh