realpage / builder
Run containers for building Laravel assets (composer dependencies, npm, etc.) via php
Requires
- php: ^7.0
- illuminate/console: ^5.2
- illuminate/support: ^5.2
- symfony/process: ^3.0
Requires (Dev)
- phpunit/phpunit: ^5.2
- squizlabs/php_codesniffer: ^2.5
This package is not auto-updated.
Last update: 2022-10-18 12:18:51 UTC
README
Containers for installing dependencies required for Laravel or Lumen projects. These containers allow us to avoid installing dependency management tooling (git, npm, composer, etc.) on the deployable containers, keeping them as lightweight as possible.
This package comes pre-installed with the Laravel Starter and Lumen Starter templates.
Installation
-
Run
composer require --dev realpage/builder
-
Register the service provider...
For Lumen, in bootstrap/app.php
:
if(class_exists('RealPage\Builder\BuilderServiceProvider')) {
$app->register(\RealPage\Builder\BuilderServiceProvider::class);
}
For Laravel, in config/app.php
:
\RealPage\Builder\BuilderServiceProvider::class,
-
Add the
npm
andcomposer
containers (find the latest containers on DockerHub) to yourdocker-compose.yml
:version: '2'
services: fpm: build: context: . dockerfile: infrastructure/fpm/Dockerfile image: realpage/lumen:fpm env_file: .env volumes: - ./:/var/www/html web: image: realpage/nginx:latest volumes: - ./infrastructure/nginx/vhost.conf:/etc/nginx/conf.d/default.conf ports: - "80:80" npm: image: realpage/builder:npm-3 volumes_from: - fpm composer: image: realpage/builder:composer-1 volumes_from: - fpm
Usage
Because of the compose package, instead of running docker run -i -v $(pwd):/var/www/html realpage/builder composer install
you can run a simple php artisan builder:composer install
.
Commands available:
$ php artisan
builder:all Build all of the requirements for this Laravel application
builder:composer Install of the composer dependencies via the builder container
builder:npm Install of the npm dependencies via the builder container