DEV Community 👩‍💻👨‍💻

Cover image for Dockerize Laravel with One Line Code- Part 1

Posted on

Dockerize Laravel with One Line Code- Part 1

Just one-line code: $sudo ./, you can execute the Laravel application in LNMP(Linux, Nginx, Mysql, PHP) environment.

  • The tutorial works for Mac M1


Quick Start

  1. Clone the repository: $ git clone
  2. Enter the directory root you just cloned: $ cd laravel-docker
  3. Execute the file as admin: $ sudo ./ If it executes successfully, you will the following msg in terminal: $ App is running.
  4. Now, open browser and go to localhost:8000, you will see Laravel homepage.
  5. Shut down all the containers started above, execute sudo docker-compose down in the same directory root

Thanks to the project: docker-compose-laravel-alpine-for-mac-m1, I built the project based on it.

I will update more details about it on my site

Top comments (2)

8n22 profile image

you are best man i take for 4 hours for running docker with laravel just work with you you are deserve engineer name

dablackestfuneral profile image
Kazaryan Fyodor

there are laravel-sail pre-built in every laravel project, I think it is better way to create environment for project

Head to your account's Settings to...

🌚 Enable dark mode
🔠 Change your default font
📚 Adjust your experience level to see more relevant content