Docker development environment construction package for Laravel application.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Laravel Docker Starter

Docker development environment construction package for Laravel application. [for Mac]

System requirements

  • Docker for Mac must be installed.
  • composer (If it is not installed, it will be installed at setup time.)

Operation confirmed environment

  • macOS Mojave
  • Docker Desktop for Mac:
  • Docker Engine: 18.09.1
  • Compose: 1.23.2

Environment to be built

app container

  • centos: Latest edition
    • Apache: 2.4
    • PHP: 7.2
    • Laravel: Latest edition

DB container

  • MySQL: 8.0

Project Structure

├── docker
│   ├── app
│   │   ├── Dockerfile         ... Dockerfile for applications
│   │   └── init
│   │       ├── .env           ... Laravel env file
│   │       └── ... Shell for starting application server
│   ├── db
│   │   ├── Dockerfile         ... Dockerfile for Database
│   │   └── conf.d
│   │       └── my.cnf         ... MySQL configuration file
│   └── docker-compose.yml     ... The app and db containers are managed by docker-compose.
├──                   ... ShellScript to operate Laravel and Docker
└── src                        ... Laravel source and configuration file installation directory

Getting started

// Download sources
git clone

// Go to the laravel-docker directory.
cd /path/to/laravel-docker

// When you start setup, Laravel will be installed and the Docker environment will be launched.
sh setup

!! POINT !!

Since migration and seeding are executed during Laravel setup, initial data can be input by defining these in advance.

When setup is complete, access localhost.


Once setup is done, operation can be controlled by start / stop.

// stop
sh stop 

// start
sh start

The Laravel project will be installed under src/

└── src
     └── laravel

The Laravel project mounts from an external volume, so it will be persisted.


sh setup    : Set up Laravel Docker.
sh start    : Alias for setup.
sh stop     : Stop the container.
sh restart  : Reboot the container.
sh destroy  : Delete containers and images.
sh conn app : Connect to app container.
sh conn db  : Connect to MySQL in db container.
sh help     : Display help.


Because it is a starter pack for a troublesome shop, it may be more convenient and the source should be still getting better. Of course, the bad part should be improved. Please send pull request by all means. We welcome your participation.


This package made Laravel easy to try under Docker environment. Since we are also committing some configuration files, we do not recommend deploying these source file sets directly in the production environment.

Have fun Laravel & Docker life!