Documentation to follow of experiences setting up Dockerized PHP applications with Laravel.
NOTE: modifications were made to accomodate customized local serving of the application, as ports 80 and 3306 are not available for local development.
- run
curl -s "https://laravel.build/example-app" | bash
to bootstrap the initial Laravel app - Change into project directory
- Make modifications (detailed below) to
docker-compose.yml
- Make modifications (detailed below) to
vendor/laravel/sail/bin/sail
- Ensure Docker Desktop is running
- Run
./vendor/bin/sail up
to start Docker - Application will be served on
localhost:8080
The following change on line 14:
ports:
- '${APP_PORT:-80}:80'
... and the following change from line 31:
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3307}:3306'
A single change on line 126:
export APP_PORT=${APP_PORT:-8080}