How to make Laravel faster with Docker for Mac

Hello everyone. This is tyamahori. Are you developing with Docker for Mac? Isn't it slow and cluttered? .. ??

Good news for you. In January 2021, tyamahori faced a slow problem with Docker for Mac. Please see the sample project of Laravel on GitHub.

Do not mount the vendor directory as it is!

After composer install, you will have a vendor directory. You need to devise a way to mount this on the container.

Then what do you do?

For local development, you'll probably use docker-compose. In that case, use volumes to avoid putting files locally on your Mac.

Pit. ..

However, if there is no vendor directory locally, PhpStorm etc. will not work. .. No matter how fast it gets, it doesn't make sense if you don't hear the complement. .. .. ??

Further ingenuity

Bring the vendor directory locally on your Mac after doing a composer installation inside the container. I have a command for docker cp, so I use it to copy the directory locally on my Mac because there is no container!


Then, when do you do docker cp? What to do if you add something with a new composer install. .. And so on. In such a case, make a script and do various trial and error. The script is placed in the sample project, so please refer to it.

Where to put up

If you bring the vendor directory locally to your Mac with docker cp, PhpStorm will read the vendor directory. At that time, Mac fans will buzz around, so you have to put up with that. ..


I'd like you to try it first to see if it really gets faster. Clone the sample project and use Docker for Mac to launch it! We look forward to hearing from you!

Project on GitHub

Recommended Posts

How to make Laravel faster with Docker for Mac
How to use nginx-ingress-controller with Docker for Mac
How to build docker environment with Gradle for intelliJ
How to install JMeter for Mac
How to start Camunda with Docker
Let's write how to make API with SpringBoot + Docker from 0
How to use mysql with M1 mac Docker preview version
How to quit Docker for Mac and build a Docker development environment with Ubuntu + Vagrant
How to share files with Docker Toolbox
How to install Play Framework 2.6 for Mac
Laravel development environment construction with Docker (Mac)
[Rails] How to use rails console with docker
Install Docker Desktop for Mac with Homebrew
Getting Started with Docker for Mac (Installation)
How to run Blazor (C #) with Docker
How to build Rails 6 environment with Docker
[For those who create portfolios] How to use binding.pry with Docker
[Java] How to test for null with JUnit
[Docker for Mac] Deal with Credentials store error
How to give your image to someone with docker
Make Volume faster when using Docker with vscode.
How to use docker compose with NVIDIA Jetson
[Rails] How to build an environment with Docker
[Java] How to make multiple for loops single
How to install Docker
How to make shaded-jar
[Laravel] How to deal with out of memory error when composer require [Docker]
How to start with Hyper-V instead of WSL2 on Docker Desktop for Windows
How to make batch processing with Rails + Heroku configuration
How to make a factory with a model with polymorphic association
How to build Docker + Springboot app (for basic learning)
How to make LINE messaging function made with Ruby
How to deal with No template for interactive request
How to make an almost static page with rails
[Docker environment] How to deal with ActiveSupport :: MessageEncryptor :: InvalidMessage
How to delete untagged images in bulk with Docker
Try connecting to AzureCosmosDB Emulator for Docker with Java
How to install Gradle and Kotlin with SDKMAN (Mac)
How to make a mod for Slay the Spire
[Docker + Rails] How to deal with Rails server startup failure
How to uninstall Java 8 (Mac)
Deploy with EC2 / Docker / Laravel
Java --How to make JTable
How to set Docker nginx
How to number (number) with html.erb
How to update with activerecord-import
[Rails] How to make seed
How to install JDK8-10 (Mac)
I tried to make an introduction to PHP + MySQL with Docker
How to decompile apk file to java source code with MAC
Wait for the container service to start with docker healthcheck
Make Docker confusing with Pokemon and make it easier to attach
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Learning Ruby with AtCoder 13 How to make a two-dimensional array
How to get started with Gatsby (TypeScript) x Netlify x Docker
How to test a private method with RSpec for yourself
How to make an app using Tensorflow with Android Studio
How to build Rails, Postgres, ElasticSearch development environment with Docker
Investigated how to call services with Watson SDK for Java
How to scroll horizontally with ScrollView
How to deploy Laravel on CentOS 7