Next.js Discord

Discord Forum

Runtime ENV Vars in Docker

Unanswered
Berger Picard posted this in #help-forum
Open in Discord
Berger PicardOP
So I've been seeing this discussed going back years in my research and seems like there still isn't a definitive answer.

Is there a way to make the next app both client and server do runtime evaluation of the Environment variables?

I'm running nextjs 14 frontend (pages router) with a separate backend. We're deploying docker images to AWS lightsail. I'm currently doing all kinds of hacky work arounds involving a bash script that literally does a find and replace on start but this cannot be a long term solution.

Is global.process.env still an option?

0 Replies