Docker build error with sveltekit

Hello everyone, whenever I try to docker build my sveltekit app that uses drizzle I get the following error:
0.187 > vite build
0.187
0.851 vite v5.4.11 building SSR bundle for production...
0.867 transforming...
1.400 ✓ 163 modules transformed.
1.451 rendering chunks...
1.866
1.866 node:internal/event_target:1101
1.866 process.nextTick(() => { throw err; });
1.866 ^
1.866 Error: DATABASE_URL is not set
1.866 at file:///app/.svelte-kit/output/server/chunks/schema.js:6:38
1.866 at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
1.866 at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
1.866 at async analyse (file:///app/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js:104:62)
1.866 at async MessagePort.<anonymous> (file:///app/node_modules/@sveltejs/kit/src/utils/fork.js:23:16)
1.866
1.866 Node.js v22.13.0
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
0.187 > vite build
0.187
0.851 vite v5.4.11 building SSR bundle for production...
0.867 transforming...
1.400 ✓ 163 modules transformed.
1.451 rendering chunks...
1.866
1.866 node:internal/event_target:1101
1.866 process.nextTick(() => { throw err; });
1.866 ^
1.866 Error: DATABASE_URL is not set
1.866 at file:///app/.svelte-kit/output/server/chunks/schema.js:6:38
1.866 at ModuleJob.run (node:internal/modules/esm/module_job:271:25)
1.866 at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:547:26)
1.866 at async analyse (file:///app/node_modules/@sveltejs/kit/src/core/postbuild/analyse.js:104:62)
1.866 at async MessagePort.<anonymous> (file:///app/node_modules/@sveltejs/kit/src/utils/fork.js:23:16)
1.866
1.866 Node.js v22.13.0
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
Is there some way to detect if i am building inside docker and then not opening a connection to my database?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?