This is a quick way to setup Laravel using Docker. This is useful for use cases like experimentation or tutorials where you just want to have a running Laravel immediately. I am new at Docker so expect that this would change as I learn more optimum practices.
It is heavily based from this tutorial. If you want more explanations and descriptions, refer to that tutorial. The focus of this writeup is just to present the barebone actual step-by-step to start using Laravel with Docker.
Fetch the codebase in Github.
Install dependencies using Composer.
Setup .env files from .env.example. Two .env files are needed, one is in the root folder, and the other is in the "src" folder. This is a temporary setup as I'm still figuring out an issue in just having one ".env" file. So assuming that .env.example files have the correct values already:
Run the docker build command.
Start the docker container.
After "step 5" Laravel homepage should be available in http://localhost:8001.
Run artisan commands.