1.) Set target directory
export LARAVEL_APP=laravelThe value of
LARAVEL_APPwill be the name of the directory where the laravel app will be created relative to your current working directory in git bash.
2.) Install Laravel via Docker
docker run --rm \
--pull=always \
-v "/$(pwd)":/opt \
-w //opt \
laravelsail/php82-composer:latest \
bash -c "laravel new ${LARAVEL_APP} && cd ${LARAVEL_APP} && php ./artisan sail:install"Wait until the installation si completed.
3.) Start Laravel docker app
docker compose up -dDone!