saltycrane / saltycrane-blog-comments

Comments for my blog powered by utterances
https://www.saltycrane.com/blog/
0 stars 0 forks source link

blog/2021/04/buildtime-vs-runtime-environment-variables-nextjs-docker/ #32

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

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/

andymeek commented 3 years ago

Great write-up, thank you!

stefee commented 3 years ago

This is excellent. 🙌

cweekly commented 2 years ago

Fantastic resource! Got a tip jar?

savager commented 2 years ago

This is the best breakdown of a complicated setup that I've seen to date. Thanks much for this resource!

hakimelek commented 2 years ago

Thank you, the tables are a great resource to differentiate between the different techniques on using env variables.

awinecki commented 2 years ago

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.

🙇‍♂️

rametta commented 2 years ago

This was super helpful. That chart of the envs should be in the official docs!

mohammadameer commented 2 years ago

great and very helpful article thank you very much

ToniLloyds commented 2 years ago

Thank you so much :)

hoangtrung99 commented 1 year ago

Looks like ENV is no longer available in the runtime environment.

cweekly commented 1 year ago

Looks like ENV is no longer available in the runtime environment.

Hi @hoangtrung99, could you please elaborate?

yalopov commented 1 year ago

Why is this so hard? Just want to be able to change environment variables in runtime :(

Thanks btw

Dacaramo commented 2 months ago

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