A pretty simplified Docker Compose workflow that sets up a LEMP network of containers for local Laravel development. You can view the full article that inspired this repo here.
To get started, make sure you have Docker installed on your system, and then clone this repository.
Next, clone your project or copy all of the files directly into src directory and start initial recipe by running make init
. This one will build and up
docker-compose, also it makes some additional steps which are required by all laravel projects.
Bringing up the Docker Compose network with site
instead of just using up
, ensures that only our site's containers are brought up at the start, instead of all of the command containers as well. The following are built for our web server, with their exposed ports detailed:
- nginx -
:8080
- mysql -
:3306
- php -
:9000
Three additional containers are included that handle Composer, NPM, and Artisan commands without having to have these platforms installed on your local computer. Use the following command examples from your project root, modifying them to fit your particular use case.
docker-compose run --rm composer update
docker-compose run --rm npm run dev
docker-compose run --rm artisan migrate