Skip to content

Local Laravel development environment using Docker, Docker Compose, Nginx, MySQL, Node, NPM, PHP and Composer

Notifications You must be signed in to change notification settings

dantas15/laravel-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✔️ Requirements

  • I'm assuming that you have Docker installed and configured for your OS (strongly recommend using WSL2 if you're using Windows)

🚢 Setup containers

Assuming you're in the root dir:

  1. Copy .env.example => .env
cp .env.example .env
  1. Build containers
docker-compose up -d
  1. Nginx and MySQL ready to go. By default, the server will be running at http://127.0.0.1:8000.

⚙ Setup Laravel project

  1. Copy src/.env.example => src/.env
cp src/.env.example src/.env
  1. Install dependencies
docker-compose run --rm composer install
  1. Generate APP_KEY
docker-compose run --rm artisan key:generate
  1. Make sure to change the .env data of your Laravel project to match the database info you provided to the .env on the root folder of this project.

How to use

NPM

docker-compose run --rm node npm #NPM command (install, run dev...)

PHP

docker-compose run --rm php #PHP command

About

Local Laravel development environment using Docker, Docker Compose, Nginx, MySQL, Node, NPM, PHP and Composer

Topics

Resources

Stars

Watchers

Forks

Languages