0x5CD59377
Docker application not finding env var set in service's Variables tab
Project ID: 21dcd679-2ad7-463a-81e8-ed549f5d467b
I have a dockerized Vite application that needs to read a var
VITE_MY_ENV_VAR
that i've set to value 'the-value'
in the Variables tab of my Railway app's service. However, the application cannot find the variable during run time (printing it's value with console.log returns undefined
). The application does successfully read the PORT variable automatically set by Railway both at build time (during an EXPOSE $PORT step) and runtime (during gunicorn --host 0.0.0.0 --port $PORT app:app
). What might be causing my application to not find the VITE_MY_ENV_VAR
variable?13 replies