Clone the setup-docker-laravel repository
git clone https://github.com/igorcfernandes/setup-docker-laravel.gitClone laravel repository
git clone https://github.com/laravel/laravel.git laravel-appCopy the docker-compose.yml and Dockerfile files and the docker/ directory inside your project
cp -rf setup-docker-laravel/* laravel-app/Go to your project folder
cd laravel-app/Create the .env file
cp .env.example .envUpdate the environment variables in .env file
APP_URL=http://localhost:8000
DB_CONNECTION=mysql
DB_HOST=db
DB_DATABASE=laravel
DB_USERNAME=username
DB_PASSWORD=password
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
REDIS_HOST=redisStart all the services
docker-compose up -dRun the following shell command inside the app container to interact with the running container
docker-compose exec app bashInstall the project dependencies
composer installGenerate the laravel project key
php artisan key:generateAccess the project http://localhost:8000