- PHP-FPM 8 (localhost:8100, application)
- NGINX
- MySQL 5.7
- phpMyAdmin (localhost:8200)
- Redis 6
- MailHog (localhost:8025)
Create a folder to hold the project files and navigate to it
mkdir laravel-docker
cd laravel-docker
Clone this repo
git clone https://github.com/isaac-souza/docker-compose-laravel.git .
Inside the folder, clone Laravel's repo to a folder called 'src'
git clone https://github.com/laravel/laravel.git src
Start the containers
docker-compose up
When all containers finish booting up, run the following command in a new terminal window to install the Laravel dependencies
docker-compose exec -T app composer install
Create a copy of the .env.example file
docker-compose exec -T app cp .env.example .env
Generate a new encryption key
docker-compose exec -T app php artisan key:generate
Ajust a few .env variables
DB_HOST=mysql
REDIS_HOST=redis
Clear the config cache
docker-compose exec -T app php artisan cache:clear
Try to access the services in your browser
- Laravel app (http://localhost:8100)
- phpMyAdmin (http://localhost:8200)
- MailHog (http://localhost:8025)