You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing a new laravel project with the installer (laravel new test), migrations are beeing run before I can choose my database of choice.
Even if I run laravel new test --database=mysql the database.sqlite file will always be created and the migrations still run on SQLite.
Because of this behaviour it has been really problematic to run Laravel on my own multipurpose Docker Base Images, because php-fpm will crash if the migrations havent been run before.
Before Laravel 11 every project would run on my images and even updated projects from Laravel 10 to Laravel 11 dont make any problems, but native Laravel 11 projects will crash php-fpm.
Steps To Reproduce
The issue
1. Install a new Laravel 11 project laravel new docker-fpm-test --database=mysql
4. Now start all the containers with the following command docker compose up -d
You will now notice that the app container wont start and it will try to restart again and again.
No docker error is beeing thrown, but you can see Exceptions in the laravel.log file, because of missing database tables.
This wasnt an issue on past Laravel versions and only startet happening since Laravel 11 and the change to SQLite.
Even upgraded Laravel 10 to Laravel 11 applications arent a problem and would work without a problem on this setup.
Because the container wont start properly, I have to run the migrations.
How to fix this issue?
1. Stop all containers docker compose down
2. Change the purpose of the app container/service to default in the docker-compose.yml so, that php-fpm wont start
CONTAINER_ROLE: default
3. Start all containers again docker compose up -d
4. Now without php-fpm running you can run the migrations docker compose exec -it app php artisan migrate
5. Stop all containers the last time docker compose down
6. Change again the purpose of the app container/service to app in the docker-compose.yml so, that php-fpm can start
CONTAINER_ROLE: app
Thats it... Now you have a running application and the app container with php-fpm wont crash again.
The problem with this is, that you can never delete the test-test-mysql docker volume or you will have to start from the beginning again while developing locally.
With other words... You cant clean your unused volumes, when working on other projects or you will have a bad time coming to this project again.
This was never a problem before Laravel 11 and it was a much better user experience, because not having run the migrations wouldnt crash the whole php-fpm.
The text was updated successfully, but these errors were encountered:
Laravel Version
11.7.0
PHP Version
8.3.6
Database Driver & Version
MySQL 8.3
Description
When installing a new laravel project with the installer (
laravel new test
), migrations are beeing run before I can choose my database of choice.Even if I run
laravel new test --database=mysql
the database.sqlite file will always be created and the migrations still run on SQLite.Because of this behaviour it has been really problematic to run Laravel on my own multipurpose Docker Base Images, because php-fpm will crash if the migrations havent been run before.
Before Laravel 11 every project would run on my images and even updated projects from Laravel 10 to Laravel 11 dont make any problems, but native Laravel 11 projects will crash php-fpm.
Steps To Reproduce
The issue
1. Install a new Laravel 11 project
laravel new docker-fpm-test --database=mysql
2. Change the following in the .env file
3. Create a docker-compose.yml file in the root folder of the newly created application
4. Now start all the containers with the following command
docker compose up -d
You will now notice that the
app
container wont start and it will try to restart again and again.No docker error is beeing thrown, but you can see Exceptions in the laravel.log file, because of missing database tables.
This wasnt an issue on past Laravel versions and only startet happening since Laravel 11 and the change to SQLite.
Even upgraded Laravel 10 to Laravel 11 applications arent a problem and would work without a problem on this setup.
Because the container wont start properly, I have to run the migrations.
How to fix this issue?
1. Stop all containers
docker compose down
2. Change the purpose of the
app
container/service todefault
in thedocker-compose.yml
so, that php-fpm wont start3. Start all containers again
docker compose up -d
4. Now without php-fpm running you can run the migrations
docker compose exec -it app php artisan migrate
5. Stop all containers the last time
docker compose down
6. Change again the purpose of the
app
container/service toapp
in thedocker-compose.yml
so, that php-fpm can startThats it... Now you have a running application and the app container with php-fpm wont crash again.
The problem with this is, that you can never delete the
test-test-mysql
docker volume or you will have to start from the beginning again while developing locally.With other words... You cant clean your unused volumes, when working on other projects or you will have a bad time coming to this project again.
This was never a problem before Laravel 11 and it was a much better user experience, because not having run the migrations wouldnt crash the whole php-fpm.
The text was updated successfully, but these errors were encountered: