fix: make migrations and job queue work in Docker standalone build

- Move instrumentation.ts to src/ so Next.js picks it up (required when using src/ layout)
- Enable experimental.instrumentationHook in next.config.mjs (required in Next.js 14)
- Switch Dockerfile deps stage from npm to bun to match lockfile
- Explicitly copy @libsql and libsql into standalone runner — Next.js file tracing
  misses dynamically required native modules (require(`@libsql/${target}`))

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
VarunandClaude Sonnet 4.6 committed 2026-04-03 21:51:00 +05:30
1 parent 5169ae3ebd
commit 550199d4f1
3 files changed
+14 -10

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
export async function register() {
// Only run on the Node.js server, not in the Edge runtime or client
if (process.env.NEXT_RUNTIME === "nodejs") {
const { runMigrations } = await import("./db");
await runMigrations();
const { resumePendingJobs } = await import("./workers/import/runner");
await resumePendingJobs();
}
}