DEV Community 👩‍💻👨‍💻

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

Posted on

Dockerize Laravel with One Line Code- Part 1

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

  • The tutorial works for Mac M1

Prerequisites

Quick Start

  1. Clone the repository: $ git clone https://github.com/ShakalakaB/laravel-docker.git
  2. Enter the directory root you just cloned: $ cd laravel-docker
  3. Execute the file setup-docker.sh as admin: $ sudo ./setup-docker.sh. 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)

Collapse
8n22 profile image
8n22

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

Collapse
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