DEV Community

Cover image for Build laravel development environment with docker
ucan_lab
ucan_lab

Posted on Edited on

Build laravel development environment with docker

I created a nice development environment for Laravel šŸ‘

Repository

https://github.com/ucan-lab/docker-laravel

Please try it ā­ļø

Installing Docker

https://docs.docker.com/docker-for-mac/install/

Project Structure

.
ā”œā”€ā”€ src # Laravel project root directory
└── infra
     ā”œā”€ā”€ docker
     │   ā”œā”€ā”€ mysql
     │   │   ā”œā”€ā”€ Dockerfile
     │   │   └── my.cnf
     │   ā”œā”€ā”€ nginx
     │   │   ā”œā”€ā”€ Dockerfile
     │   │   ā”œā”€ā”€ Dockerfile.production
     │   │   └── default.conf
     │   └── php
     │       ā”œā”€ā”€ Dockerfile
     │       ā”œā”€ā”€ Dockerfile.production
     │       ā”œā”€ā”€ bash
     │       │   ā”œā”€ā”€ .bash_history
     │       │   └── psysh
     │       ā”œā”€ā”€ php-fpm.d
     │       │   └── zzz-www.conf => unix domain socket config file
     │       ā”œā”€ā”€ php.ini
     │       └── php.production.ini
     └── docker-compose.yml
šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026 šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026

How to use

Read the Makefile for the contents

A. Create a new laravel project

$ git clone git@github.com:ucan-lab/docker-laravel.git
$ cd docker-laravel
$ mkdir -p src
$ docker compose build
$ docker compose up -d
$ docker compose exec app composer create-project --prefer-dist laravel/laravel .
$ docker compose exec app php artisan key:generate
$ docker compose exec app php artisan storage:link
$ docker compose exec app chmod -R 777 storage bootstrap/cache
$ docker compose exec app php artisan migrate
šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026 šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026

http://localhost

B. Create a clone laravel project

$ git clone git@github.com:ucan-lab/docker-laravel.git
$ cd docker-laravel
$ mkdir -p src
$ docker compose build
$ docker compose up -d

$ docker compose exec app composer create-project --prefer-dist "laravel/laravel=6.*" .

$ docker compose exec app php artisan key:generate
$ docker compose exec app php artisan storage:link
$ docker compose exec app chmod -R 777 storage bootstrap/cache
$ docker compose exec app php artisan migrate
šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026 šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026

http://localhost

Top comments (3)

šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026
 
amitavroy7 profile image
Amitav Roy •

Well, if you are sharing a repo publicly for others to use, then shouldn't you put things to default. I can see the timezone being set to Tokyo, Japan. Now, those who are not very familiar will be having a problem.

šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026
 
ucan_lab profile image
ucan_lab • • Edited

Thank you for your feedback. That's right.
The time zone, locale, and MySQL string collation were set to Japan.
It has been restored to the default so that many people can use it.

github.com/ucan-lab/docker-laravel...

šŸ”“ Live TV: ucan lab/build laravel development environment with docker lbo - Info Live Streaming 2026
 
amitavroy7 profile image
Amitav Roy •

Thank you for talking my feedback in a positive way and for that quick fix.