Skip to content

Latest commit

 

History

History
113 lines (79 loc) · 2.97 KB

README.md

File metadata and controls

113 lines (79 loc) · 2.97 KB

docker-laravel 🐳

docker-laravel

Test laravel-create-project.yml Test laravel-git-clone.yml License

Introduction

Build a simple laravel development environment with Docker Compose. Support with Windows(WSL2), macOS(Intel and Apple Silicon) and Linux.

Usage

Create an initial Laravel project

  1. Click Use this template
  2. Git clone & change directory
  3. Execute the following command
$ task for-linux-env # Linux environment only
$ task create-project

# or...

$ make for-linux-env # Linux environment only
$ make create-project

# or...

$ echo "UID=$(id -u)" >> .env # Linux environment only
$ echo "GID=$(id -g)" >> .env # Linux environment only

$ 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

http://localhost

Create an existing Laravel project

  1. Git clone & change directory
  2. Execute the following command
$ task for-linux-env # Linux environment only
$ task install

# or...

$ make for-linux-env # Linux environment only
$ make install

# or...

$ echo "UID=$(id -u)" >> .env # Linux environment only
$ echo "GID=$(id -g)" >> .env # Linux environment only

$ docker compose build
$ docker compose up -d
$ docker compose exec app composer install
$ docker compose exec app cp .env.example .env
$ 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

http://localhost

Tips

Container structures

├── app
├── web
└── db

app container

web container

db container

mailpit container