R
Railway5mo ago
Pepijn

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:
Nvm solved it, seems it was an issue in the start CMD eventually just used an entrypoint with a bash startup script
Jump to solution
3 Replies
Percy
Percy5mo ago
Project ID: c6f6b68a-8b76-42d7-bd0a-65e794ac8fef
Pepijn
PepijnOP5mo ago
c6f6b68a-8b76-42d7-bd0a-65e794ac8fef
Solution
Pepijn
Pepijn5mo ago
Nvm solved it, seems it was an issue in the start CMD eventually just used an entrypoint with a bash startup script
Want results from more Discord servers?
Add your server