LaraDock Multi
Laradock wrapper template for running multiple related projects with different versions of PHP and Node.js such as Microservice Architecture (MSA)
- LaraDock without rewrite original files
- Laravel with
PHP 7.4
- CoruUi as
Node.JS
example - Microservice Architecture as concept
- Docker Compose
localhost on dev env
- default
- api.localhost
- laravel.localhost
- dashboard.localhost switched off by default
- Integrate Demo of usage with Cloud env (
Yandex Cloud
for example as simple and useful)
cmd/bash.sh laravel
- connect toLaraDock-multi
servicecmd/logs.sh
- waiting for all logscmd/logs.sh nginx laravel
- waiting for logs of nginx andlaravel
workers or clicmd/ps.sh
- shop details aboutLaraDock-multi
servicescmd/rebuild.sh
- remove, load updates and rebuild each oneLaraDock-multi
servicescmd/rebuild.sh laravel-fpm nginx
rebuild onlylaravel-fpm
andnginx
cmd/stop.sh
- stop all servicescmd/stop.sh nginx api
- stop services:nginx
andapi
cmd/test_tor_proxy.sh
- test TOR proxycmd/up.sh
- start all servicescmd/up.sh nginx api
- start services:nginx
andapi
apt install docker docker-compose git
git clone https://github.com/bagart/laradock-multi.git
cd laradock-multi
You cal automate Configure, Upgrade and download Laradock
with command
cmd/deploy.sh
Force Upgrade Laradock Multi
. It's will remove laradock
path
cmd/deploy.sh upgrade
git clone https://github.com/Laradock/laradock.git
cp ./.laradock-multi/. ./laradock/ -r
Also, you can use git submodule add https://github.com/Laradock/laradock.git
I will use dummy laravel-like php site for demo
mkdir projects/laravel
mkdir projects/laravel/public
echo '<?php phpinfo();' >> projects/laravel/public/index.php
But you can install original laravel or your exist project
composer create-project --prefer-dist laravel/laravel projects/laravel
I will use pretty CoreUi
admin template on ReactJS
git clone https://github.com/coreui/coreui-free-react-admin-template.git projects/dashboard
cp laradock/nginx/sites/dashboard.conf.example laradock/nginx/sites/dashboard.conf
It's already added: dashboard
docker in docker-compose.multi.yml.
You can copy this section for using with other node.js projects
Feel free to changing .laradock-multi options
Using is similar to https://github.com/bagart/laradock_env
cmd/up.sh
- Nginx crush in runtime after load config, if some dependency service (php-fpm, node.js) not started.
So, immediately
cmd/ps.sh
will return success result and failed in next call - laravel service is empty by default
- dashboard not configured by default
- dashboard take a time to building CoreUI
- dashboard:8081 direct (without
Nginx
) - laravel
- api
Also you can use docker-compose.override.yml
https://docs.docker.com/compose/extends/.
But it's depends on platform
cd laradock;
cp docker-compose.multi.yml docker-compose.override.yml
and remove all typical service like db or docker-in-docker
Result:
docker-compose ps
will equal:docker-compose ps -f docker-compose.yml -f docker-compose.override.yml
docker-compose logs
will equal:docker-compose logs -f docker-compose.yml -f docker-compose.override.yml
But docker-compose up
without specs will failed
Open default preoject with IDE
Switch to internal bash terminal
use Laradock-multi
:
cmd/up.sh
copy this dir to each new project
cp -r projects/default/cmd projects/laravel/cmd
git pull
cd laradock
git pull
cd ..
add all changes
-
from:
diff .laradock-multi/docker-compose.yml.orig laradock/docker-compose.yml
- to
laradock/docker-compose.multiple.yml
workspace
toapi
,laravel
,default
php-fpm
toapi-fpm
,laravel-fpm
,php-fpm
- each one with same name
- to
-
from:
diff .laradock-multi/env-example.orig laradock/env-example
- to
laradick/.env
- to
Rebuild each Laradock-Multi
service
cmd/rebuild.sh
- .laradock-multi/ - custom services path for
LaraDock
- xdebug.ini - custom
xdebug.ini
options fprPHP
- .env - custom php.ini options
- docker-compose.multi.yml - custom docker-compose services
- docker-compose.yml.orig - last synced original
docker-compose.yml
(for diff) - env-example.orig - last synced original
.env
(for diff) - node/ - new docker service template with
Node.JS
- nginx/sites/ - path with custm
fcgi
andproxy
services- api.conf - example with
PHP 5.6
- dashboard.conf - example with
Node.JS
andCoreUi for React
- laravel.conf - example Laravel on
PHP 7.4
- api.conf - example with
- xdebug.ini - custom
- cmd/ - simple command for using with autocomplete
- .jump_to_laradock.sh - cd to
LaraDock
path (for internal use) - bash.sh - connect to
LaraDock-multi
service - logs.sh -
logs -f
allLaraDock-multi
service orcmd/logs.sh laravel nginx
for listed - ps.sh - show info for
LaraDock-multi
service - rebuild.sh - remove, pull and rebuild each one LaraDock-multi services or
cmd/rebuild.sh laravel nginx
for listed - stop.sh - stop
LaraDock-multi
services orcmd/stop.sh laravel nginx
for listed - up.sh - start all
LaraDock-multi
services orcmd/up.sh laravel nginx
for listed
- .jump_to_laradock.sh - cd to
- dumps/ - path for DB dumps. That will be mount inside DB-service
- laradock/ - original
laradock
+laradock-multi
- projects/ - custom projects
- api/ - API project with
PHP 5.6
- dashboard/ - CoreUI project with
NodeJS
+React
(after install) - default/ - Default localhost project for internal use or service list
- laravel/ -
Laravel
project withPHP 7.4
(after install)
- api/ - API project with
- Readme.md - Readme file with instructions