Dockerize Laravel with One Line Code
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
- Docker installed
Quick Start
- Clone the repository:
$ git clone https://github.com/ShakalakaB/laravel-docker.git
- Enter the directory root you just cloned:
$ cd laravel-docker
- 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
. - Now, open browser and go to localhost:8000, you will see Laravel homepage.
- 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.