- nginx 1.15
- php 7.3
- Mysql 5.7
- redis 5.0
Just copy the app.docker, docker-compose.yml, vhost.conf and web.docker files to your laravel project source directory and run
$ docker-compose up -d
OR
$ cd laravel-project-source
$ git clone https://github.com/jpcanoso/docker-laravel.git
$ docker-compose up -d
You will need to configure the connection details on the .env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=33061
DB_DATABASE=docker
DB_USERNAME=root
DB_PASSWORD=secret
First you will need to install the predis package for Laravel
$ composer require predis/predis
Then setup your .env file accordingly
CACHE_DRIVER=redis
REDIS_HOST=127.0.0.1
REDIS_PORT=63791
| IMAGE | Ports |
|---|---|
| NGINX | 8080->80 |
| PHP | 9000 |
| MYSQL | 33061->3306 |
| REDIS | 63791->6379 |
All the ports can be changed on docker-compose.yml file. The nginx version can be changed on the web.docker file. Check the supported versions here
The php version can be changed on the app.docker file. Check the supported versions here
The mysql and redis versions can be changed on the docker-compose.yml file. Check the supported versions respectively here and here.