Open utterances-bot opened 3 years ago
Great write-up, thank you!
This is excellent. 🙌
Fantastic resource! Got a tip jar?
This is the best breakdown of a complicated setup that I've seen to date. Thanks much for this resource!
Thank you, the tables are a great resource to differentiate between the different techniques on using env variables.
Thank you! Getting a good production setup with Docker and Next.js is nontrivial, unfortunately. This article helps a lot to understand the options that are available.
🙇♂️
This was super helpful. That chart of the envs should be in the official docs!
great and very helpful article thank you very much
Thank you so much :)
Looks like ENV is no longer available in the runtime environment.
Looks like ENV is no longer available in the runtime environment.
Hi @hoangtrung99, could you please elaborate?
Why is this so hard? Just want to be able to change environment variables in runtime :(
Thanks btw
Cool blog post, but currently in 2024 it is not possible to have server side only env variables in a standalone build. So basically if you want your variables to be accessible they have to always be preceded by NEXT_PUBLIC, if you don't do that your variables won't be accessible at all. I write this because I've debugged my app for 2 days straight and I found that the issue was not coming neither from my CI, neither from my Dockerfile, but it was caused by Next.js itself.
More info here: #46296
Buildtime vs runtime environment variables with Next.js and Docker - SaltyCrane Blog
https://www.saltycrane.com/blog/2021/04/buildtime-vs-runtime-environment-variables-nextjs-docker/