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
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
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
Top comments (3)
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.
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...
Thank you for talking my feedback in a positive way and for that quick fix.