Nextjs 13 Environmental variable

Hello! I recently installed Nextjs to try out the "new" app directory, because I heard server actions are cool. I am using a Dockerfile to deploy, and before I run the build command, I also inject the env variables like this: ARG tmp ENV NEXT_PUBLIC_TMP=$tmp For some reason I can deploy without any problems but when I navigate to the project, I instantly get a message that it cant see the environmental variables. Has anyone had this problem before?
Solution:
no need for ENV just do ARG NEXT_PUBLIC_TMP assuming the variable next wants is NEXT_PUBLIC_TMP after all
Jump to solution
5 Replies
Percy
Percy11mo ago
Project ID: N/A
double_ducker
double_ducker11mo ago
N/A
Solution
Brody
Brody11mo ago
no need for ENV just do ARG NEXT_PUBLIC_TMP assuming the variable next wants is NEXT_PUBLIC_TMP after all
double_ducker
double_ducker11mo ago
Okay, I am going to give it a try It works perfectly! Thanks
Brody
Brody11mo ago
awesome!