Closed foolishell closed 1 year ago
Docker version 20.10.20 PHP 8.1.13 (on Docker) Laravel Framework 9.40.0 (on Docker)
I cloned this template and executed below commands.
$ mkdir -p src $ docker compose build $ docker compose up -d $ docker compose exec app composer create-project --prefer-dist laravel/laravel . $ docker compose exec app php artisan key:generate
Then, this error happened.
Unable to set application key. No APP_KEY variable was found in the .env file.
Environment variables on Docker conflicts below implementation of laravel/framework
https://github.com/laravel/framework/commit/5a36ee93c72be8278b41b6e20d08b0bbf7d9f3e4
Probably we need one of below changes.
- APP_KEY=${APP_KEY:-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
docker compose exec app php artisan key:generate
Sorry, for my poor English.
How occurred
Docker version 20.10.20 PHP 8.1.13 (on Docker) Laravel Framework 9.40.0 (on Docker)
I cloned this template and executed below commands.
Then, this error happened.
Problem
Environment variables on Docker conflicts below implementation of laravel/framework
https://github.com/laravel/framework/commit/5a36ee93c72be8278b41b6e20d08b0bbf7d9f3e4
Suggest Change
Probably we need one of below changes.
- APP_KEY=${APP_KEY:-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX}
)docker compose exec app php artisan key:generate
)Other
Sorry, for my poor English.