It is a minimum configuration Docker Laravel development environment created without one file of docker-compose.yml
, web server container, database server container.
docker-compose.yml
1 file only
docker-compose.yml
docker-compose.yml
version: "3.8"
services:
composer:
image: composer:2.0
volumes:
- ./backend:/work/backend
working_dir: /work/backend
app:
image: php:7.4-cli-buster
ports:
- 8000:8000
volumes:
- ./backend:/work/backend
working_dir: /work/backend
command: php artisan serve --host=0.0.0.0
$ docker-compose run composer create-project --prefer-dist laravel/laravel .
#Laravel version specification
$ docker-compose run composer create-project --prefer-dist "laravel/laravel=6.*" .
$ docker-compose up -d app
http://localhost:8000
No need to build Dockerfile. Therefore, composer is also made in separate containers.
It's faster than making cup noodles, and it's so simple that you can make it just by boiling water.
It takes time to build the Dockerfile. When it is not necessary to create strongest configuration to create a trial environment for Laravel.
GitHub
-Build the strongest Laravel development environment using Docker [new edition] -Create a local development environment for Laravel using Docker (Apache version) -[Super Introduction] Docker Hands-on to Build Laravel Development Environment at Explosive Speed in 20 Minutes
Recommended Posts