Setting up Laravel in the local environment with Docker using the LEMP stack that includes: Nginx, MySQL, PHP, and phpMyAdmin.
- Consistent development environment for the entire team.
- You don't need to install a bunch of language environments on your system.
- You can use different versions of the same programming language.
- Deployment is easy
git clone [email protected]:hanieas/Docker-Laravel.git
docker-compose exec app composer install
- Copy
.env.example
to.env
docker-compose build
docker compose up -d
- You can see the project on
127.0.0.1:8080
- Uncomment the MySQL configuration inside the
docker-compose.yml
including:db
andphpMyAdmin
- Copy
.env.example
to.env
- Change
DB_CONNECTION
tomysql
- Change
DB_PORT
to3306
- Open the
phpMyAdmin
on127.0.0.1:3400
- Uncomment the PostgreSQL configuration inside the
docker-compose.yml
including:db
andpgamdin
- Copy
.env.example
to.env
- Change
DB_CONNECTION
topgsql
- Change
DB_PORT
to5432
- Open the
pgAdmin
on127.0.0.1:5050
cd src
docker-compose exec app php artisan {your command}
https://medium.com/@hanieasemi/setting-up-a-laravel-local-environment-with-docker-7541ae170daf