One file of Docker x Laravel threat! Build a local development environment with the minimum configuration

It is a minimum configuration Docker Laravel development environment created without one file of docker-compose.yml, web server container, database server container.

environment

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

How to use

Creating a Laravel project

$ docker-compose run composer create-project --prefer-dist laravel/laravel .

#Laravel version specification
$ docker-compose run composer create-project --prefer-dist "laravel/laravel=6.*" .

Launch Laravel built-in server

$ docker-compose up -d app

http://localhost:8000

Sticking points

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.

Reason for making

It takes time to build the Dockerfile. When it is not necessary to create strongest configuration to create a trial environment for Laravel.

GitHub

Recommended articles

-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

One file of Docker x Laravel threat! Build a local development environment with the minimum configuration
Build a PureScript development environment with Docker
Build a Wordpress development environment with Docker
Build a Laravel / Docker environment with VSCode devcontainer
Build a WordPress development environment quickly with Docker
[Copy and paste] Build a Laravel development environment with Docker Compose Part 2
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
Build a local development environment for Rails tutorials with Docker (Rails 6 + PostgreSQL + Webpack)
[Copy and paste] Build a Laravel development environment with Docker Compose Participation
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Build a local development environment for Open Distro for Elasticsearch with multiple nodes using Docker
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Build docker + laravel environment with laradock
I tried to build the environment of PlantUML Server with Docker
Build a browser test environment using Capybara in the Docker development environment
Build a development environment for Django + MySQL + nginx with Docker Compose
How to build an environment with Docker, which is the minimum required to start a Rails application
[Be careful about changing the version of Xdebug! ] Create a development environment with Xdebug3 + docker + VS Code
Laravel development environment construction with Docker (Mac)
Build a simple Docker + Django development environment
Build debug environment on container --Build local development environment for Rails tutorial with Docker-
Make a daily build of the TOPPERS kernel with Gitlab and Docker
Build an environment of "API development + API verification using Swagger UI" with Docker
Build a hot reload development environment with Docker-compose using Realize of Go
I tried to build a Firebase application development environment with Docker in 2020
Template: Build a Ruby / Rails development environment with a Docker container (Ubuntu version)
Template: Build a Ruby / Rails development environment with a Docker container (Mac version)
Build a development environment for Docker + Rails6 + Postgresql
Improve the performance of your Docker development environment
Build a simple Docker Compose + Django development environment
Build a container for Docker x Laravel phpMyAdmin
[Win10] Build a JSF development environment with NetBeans
A reminder of Docker and development environment construction
Build a development environment for Docker, java, vscode
[First team development ②] Build an environment with Docker
Wordpress local environment construction & development procedure with Docker
Create a Spring Boot development environment with docker
Build a Java development environment with VS Code
Build a development environment to create Ruby on Jets + React apps with Docker
Until you build a Nuxt.js development environment with Docker and touch it with VS Code
[Rails] [Docker] Copy and paste is OK! How to build a Rails development environment with Docker
Docker the development environment of Ruby on Rails project
Build an environment of Ruby2.7.x + Rails6.0.x + MySQL8.0.x with Docker
Easily build a Vue.js environment with Docker + Vue CLI
Build Docker + Laravel PHP + Vue.js development environment in 5 minutes
About the solution of the error that occurred when trying to create a Japanese file of devise in the Docker development environment
[Note] Build a Python3 environment with Docker in EC2
[First team development ③] Share the development environment created with Docker
How to quit Docker for Mac and build a Docker development environment with Ubuntu + Vagrant
How to build a Jenkins server with a Docker container on CentOS 7 of VirtualBox and access the Jenkins server from a local PC
Build Java development environment with WSL2 Docker VS Code
A command that definitely cleans the local docker environment
SSL in the local environment of Docker / Rails / puma
Build Rails (API) x MySQL x Nuxt.js environment with Docker
[Environment construction] Build a Java development environment with VS Code!
Build WordPress environment with Docker (Local) and AWS (Production)
Try to build a Java development environment using Docker
Make the strongest Laravel development environment (Docker) Japan time
Debug the VSCode + Docker + PHP development environment with XDebug.
Build a local development environment for Rails tutorials with Docker-Introduce Bootstrap and Font Awesome with Webpack-