Skip to content
المشاريع

حول

🐳 أنشئ بيئة تطوير بسيطة لـ Laravel باستخدام Docker Compose.

تطوير الويب والتطبيقات

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
؜-١
خلال 15 يومًا
؜-١
خلال شهر
؜-٢

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

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.

Requirements

  • Docker Engine v23.0+ (BuildKit enabled by default) or the latest Docker Desktop

The Dockerfile uses here-documents (RUN <<EOF), which require BuildKit. When BuildKit is disabled (e.g. an old Docker version or the legacy builder), the RUN instructions are silently skipped, so required packages such as git are never installed. The build still succeeds, but composer install later fails with git was not found in your PATH.

BuildKit is enabled by default on Docker Engine v23.0+ and Docker Desktop. If you must use an older Docker, enable it explicitly before building:

export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

Usage

Create an initial Laravel project

  1. Click Use this template
  2. Git clone & change directory
  3. Execute the following command
$ task create-project

# or...

$ make create-project

# or... Linux environment

$ echo "UID=$(id -u)" >> .env
$ echo "GID=$(id -g)" >> .env
$ echo "USERNAME=$(whoami)" >> .env

$ mkdir -p src
$ docker compose build
$ docker compose --file compose.yaml --file compose-for-linux.yaml up --detach
$ docker compose exec app composer create-project --prefer-dist laravel/laravel .
$ docker compose exec app cp .env.example .env
$ docker compose exec app sed  -i 's/DB_CONNECTION=.*/DB_CONNECTION=mysql/' .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
$ 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 install

# or...

$ make install

# or... Linux environment

$ echo "UID=$(id -u)" >> .env
$ echo "GID=$(id -g)" >> .env
$ echo "USERNAME=$(whoami)" >> .env

$ docker compose build
$ docker compose --file compose.yaml --file compose-for-linux.yaml up --detach
$ docker compose exec app composer install
$ docker compose exec app cp .env.example .env
$ docker compose exec app sed  -i 's/DB_CONNECTION=.*/DB_CONNECTION=mysql/' .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

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…