Env file not located.

dphungTRIAL

a year ago

I currently have a docker file to deploy my golang project.

My golang file requires env variables, and takes them from the .env file.

Whenever running, godotenv.Load will throw an error sicne there is no env file. Setting variables from railway itself does not work.

1 Replies

a year ago

When on Railway you don't need to load environment variables from an .env file, that's only for local development.

Instead have your code check to see if the .env file exists, if it does, load the .env file, if it doesn't, do nothing (or print an info message) and continue on.


Env file not located. - Railway Help Station