Next.js Discord

Discord Forum

what is the straightforward solution to build docker for development env?

Unanswered
Cane di Oropa posted this in #help-forum
Open in Discord
Cane di OropaOP
next build force NODE_ENV=production
i know this is a long history problem for nextjs developer, not sure do things changes in nextjs15

1 Reply

Burmese
The behaviour of @next/env is not very flexible. NODE_ENV is only respected if it is test, and there is no way to load a staging/preview env file.

BUT - I just released a library which allows more granular control over which .env.XXX files are loaded - https://varlock.dev/integrations/nextjs/

Happy to help more if you get stuck