Env variables available during build but not runtime of PHP application
pepijn
PROOP

2 years ago

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.

2 Replies

pepijn
PROOP

2 years ago

c6f6b68a-8b76-42d7-bd0a-65e794ac8fef


pepijn
PROOP

2 years ago

Nvm solved it, seems it was an issue in the start CMD eventually just used an entrypoint with a bash startup script


Loading...