Simple steps to Dockerize your Laravel app
Laravel php Docker nginx MySQL phpmyadmin
.
├── dockerfiles
│ ├── nginx
│ │ └── default.conf
| └── nginx.dockerfile
| └── php.dockerfile
├── mysql
├── src
└── docker-compose.yml
3 directories, 4 files
First clone this repository for command:
$ git clone https://github.com/JoneCoder/dockerize-laravel.git
Second change the directory this command:
$ cd dockerize-laravel/
Make mysql directory this command:
$ mkdir mysql
Build & run project on detach mode with "Docker" this command:
$ docker-compose up -d --build
Now change the directory this command:
$ cd src/
Than copy the .env.example file to .env flowing command:
$ cp .env.example .env
Now update composer for install laravel vendor:
$ docker-compose run --rm composer install
If composer installing done than you generate application key for this command:
$ docker-compose run --rm artisan key:generate
Migrate a database run the flowing command:
$ docker-compose run --rm artisan migrate
Install and run npm this command:
$ docker-compose run --rm npm install && npm run dev
If you done all stuffs than open your favorite browser hit localhost port 8082:
http://localhost:8080
Enjoy this service.