The Problem
When using PHP CLI Docker images, the network of the docker-compose is not accessible, meaning commands like php artisan migrate will fail due to an inability of the CLI to communicate with the Docker-hosted database server.
The Solution
As part of my Laravel QuickStart project, my PHP CLI Docker container will automagically detect any running Docker Network inside the current working directory, and it autoconfigures the php container to use it.
If you want, I'm more than happy to contribute that to this project.
The Problem
When using PHP CLI Docker images, the network of the
docker-composeis not accessible, meaning commands likephp artisan migratewill fail due to an inability of the CLI to communicate with the Docker-hosted database server.The Solution
As part of my Laravel QuickStart project, my PHP CLI Docker container will automagically detect any running Docker Network inside the current working directory, and it autoconfigures the
phpcontainer to use it.If you want, I'm more than happy to contribute that to this project.