Awesome Open Source
Awesome Open Source

Docker Images for Laravel development

Docker Build Status Docker Build Status Docker Build Status

This repository provides you a development environment without requiring you to install PHP, a web server, and any other server software on your local machine. For this, it requires Docker and Docker Compose.


  1. Install docker and docker-compose ;

  2. Copy docker-compose.yml file to your project root path, and edit it according to your needs ;

  3. From your project directory, start up your application by running:

docker-compose up
  1. If you want, you can run composer or artisan through docker. For instance:
docker-compose exec php composer install
docker-compose exec php php artisan migrate
docker-compose exec php $yourCommandHere

Docker Images

These docker images are configured in docker-compose.yml file. You can comment or uncomment some services according to your project.

  • jguyomard/laravel-php:7.3 (this docker image extends php:7.3-fpm-alpine to add some PHP extensions) ;
  • jguyomard/laravel-nginx:1.13 (this docker image extends nginx:1.13-alpine to add Laravel vhost) ;
  • mysql:5.7 ;
  • postgres:9.6-alpine ;
  • redis:4.0-alpine ;
  • elasticsearch:5.5-alpine.

Other tools

This repository also comes with a caspistrano docker image: jguyomard/laravel-capistrano:3.9.

For ease of use, you can create a bash alias:

alias cap='docker run --rm --user cap -v "$PWD":/src -v "$(dirname $SSH_AUTH_SOCK)":"$(dirname $SSH_AUTH_SOCK)" -e SSH_AUTH_SOCK="${SSH_AUTH_SOCK}" jguyomard/laravel-capistrano:3.9 cap'


Contributions are welcome! Leave an issue on Github, or create a Pull Request.


This work is under MIT licence.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Php (395,188
Docker (34,491
Dockerfile (28,529
Laravel (13,252
Mysql (12,501
Postgresql (7,999
Redis (6,835
Docker Compose (6,689
Nginx (5,218
Docker Image (4,928
Related Projects