Setting up Laravel in the local environment with Docker using the LEMP stack that includes: Nginx, MySQL/Postgres, PHP, and pgsql/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 git@github.com:ryanmwakio/Docker-Laravel.git
cd src
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}