Env variables available during build but not runtime of PHP application
I have succesfully been able to build a laravel project with a custom dockerfile, and the container gets up and running. The only thing not working seems to be the loading of the variables. I have also added a test.php file to read from getenv / $_ENV / $_SERVER but all of those turn up empty. (https://backend-staging-9bdd.up.railway.app/test.php)
With our NodeJs/NextJs projects everything works fine.
Solution:Jump to solution
Nvm solved it, seems it was an issue in the start CMD eventually just used an entrypoint with a bash startup script
3 Replies