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.JSexample - 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 Cloudfor example as simple and useful)
cmd/bash.sh laravel- connect toLaraDock-multiservicecmd/logs.sh- waiting for all logscmd/logs.sh nginx laravel- waiting for logs of nginx andlaravelworkers or clicmd/ps.sh- shop details aboutLaraDock-multiservicescmd/rebuild.sh- remove, load updates and rebuild each oneLaraDock-multiservicescmd/rebuild.sh laravel-fpm nginxrebuild onlylaravel-fpmandnginxcmd/stop.sh- stop all servicescmd/stop.sh nginx api- stop services:nginxandapicmd/test_tor_proxy.sh- test TOR proxycmd/up.sh- start all servicescmd/up.sh nginx api- start services:nginxandapi
apt install docker docker-compose gitgit clone https://github.com/bagart/laradock-multi.git
cd laradock-multiYou can automate Configure, Upgrade and download Laradock with command
cmd/deploy.shForce Upgrade Laradock Multi. It's will remove laradock path
cmd/deploy.sh upgradegit clone https://github.com/Laradock/laradock.git
cp ./.laradock-multi/. ./laradock/ -rAlso, 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.phpOr install original laravel or your exist project
composer create-project --prefer-dist laravel/laravel projects/laravelOr just link to exist path
ln -s ../../../somename/ projects/somenameI 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.confIt'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.shwill 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.ymland remove all typical service like db or docker-in-docker
Result:
docker-compose pswill equal:docker-compose ps -f docker-compose.yml -f docker-compose.override.yml
docker-compose logswill 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.shcopy 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.ymlworkspacetoapi,laravel,defaultphp-fpmtoapi-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.inioptions 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
fcgiandproxyservices- api.conf - example with
PHP 5.6 - dashboard.conf - example with
Node.JSandCoreUi 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
LaraDockpath (for internal use) - bash.sh - connect to
LaraDock-multiservice - logs.sh -
logs -fallLaraDock-multiservice orcmd/logs.sh laravel nginxfor listed - ps.sh - show info for
LaraDock-multiservice - rebuild.sh - remove, pull and rebuild each one LaraDock-multi services or
cmd/rebuild.sh laravel nginxfor listed - stop.sh - stop
LaraDock-multiservices orcmd/stop.sh laravel nginxfor listed - up.sh - start all
LaraDock-multiservices orcmd/up.sh laravel nginxfor 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/ -
Laravelproject withPHP 7.4(after install)
- api/ - API project with
- Readme.md - Readme file with instructions