Skip to content

zsardarov/docker-compose-laravel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-compose-laravel

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.

Usage

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

About

A Docker environment for local Laravel development

Resources

Stars

Watchers

Forks

Languages

  • Makefile 54.1%
  • Dockerfile 45.9%