Build a simple laravel development environment with mysql , redis by docker compose
Build a simple laravel development environment with docker-compose. Compatible with Windows, macOS and Linux with mysql , redis by docker compose
See Prerequisites for notes on how to deploy the project on your system.
- Install
docker
in your system. - Clone the project
https://github.com/majidfeiz/laravel-docker.git
- Make development environment ready using commands below :
$ git clone https://github.com/majidfeiz/laravel-docker.git
$ cd laravel-docker
$ git clone https://github.com/laravel/laravel.git src
$ cp .env.example .env
$ docker-compose up -d
$ docker exec -it laravel-web cp .env.example .env
$ docker exec -it laravel-web php artisan key:generate
Now you can start your laravel on your custom port for example localhost:8080 or 127.0.0.1:8080
Install docker in your system using below links :
If you need to write command on your laravel project follow below commands :
docker exec -it laravel-web php artisan ....
If you need go in container follow below command:
docker exec -it laravel-web /bin/bash
If you need go on redis cli follow below command :
docker exec -it laravel-redis redis-cli
If you need go in mysql follow below command :
docker exec -it laravel-db mysql -u test -p
If you need phpmyadmin
open localhost
on port 8080 and fill in username and password
Note : your database host name is laravel-db
- @Majidfeiz - Idea & Initial work
See also the list of contributors who participated in this project.