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 <noreply@anthropic.com>
This commit is contained in:
@@ -47,8 +47,10 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|||||||
# Create data directory for SQLite
|
# Create data directory for SQLite
|
||||||
RUN mkdir -p /app/data && chown nextjs:nodejs /app/data
|
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/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 ./
|
COPY --chown=nextjs:nodejs start.sh ./
|
||||||
RUN chmod +x start.sh
|
RUN chmod +x start.sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user