I'm having trouble working with environment variables in Docker.
For some reason Laravel can't see the environment variables I set within Dockerfile. Like APP_KEY, APP_ENV, etc. But when I SSH into the docker container:
docker exec -it [container_name] bash
and run the following:
php artisan tinker
> print_r($_ENV)
The environment variable exists and is set to the proper value. However, when I tried to do the same within the Blade template, I don't see the APP_KEY, APP_ENV variables at all. I've edited the php.ini file in the Docker container so that it shows
variables_order = 'EGPCS'
Is .env file the only way I can pass environment variables into Laravel?
I appreciate all your help.
Cheers
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire