Replies: 4 suggested answers 15 replies
-
If you don't want to have your environment variables built into your bundles, you could take a look at the runtime configuration options. As mentioned in this doc though:
|
Beta Was this translation helpful? Give feedback.
-
@jamesmosier |
Beta Was this translation helpful? Give feedback.
-
I also have this problem. publicRuntimeConfig doesn't pick up process.env.ANYTHING. Is there any solution to this? |
Beta Was this translation helpful? Give feedback.
{{editor}}'s edit
{{editor}}'s edit
-
Beta Was this translation helpful? Give feedback.
-
So I spend a lot of time debugging this and trying to figure out a better approach to build application on the docker. After running a simple
Dockerfile
I have mention that non of my .env variables doesn't work, and I assume this is really common problem after 9.4 release where we have to specify env var asNEXT_PUBLIC_
(which doesnt work for on runtime configurations) I know that I can go with aARG
on buildtime but this is not a option for me because the application is multi domain application which needs different env var in different domains. My general question to the community of next.js is there a way and how to trigger runtime variables after application image is build and before docker container is running?P.S. next.js application uses a
express
server as custom server, and I dont use any of theserverless
featuresBeta Was this translation helpful? Give feedback.