realpage / builder
通过 php 运行构建 Laravel 资产(composer 依赖项、npm 等)的容器
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
安装用于 Laravel 或 Lumen 项目所需依赖的容器。这些容器允许我们避免在可部署的容器中安装依赖管理工具(git、npm、composer 等),使它们尽可能轻量。
此包预装了 Laravel Starter 和 Lumen Starter 模板。
安装
-
运行
composer require --dev realpage/builder
-
注册服务提供者...
Lumen 中,在 bootstrap/app.php
if(class_exists('RealPage\Builder\BuilderServiceProvider')) {
$app->register(\RealPage\Builder\BuilderServiceProvider::class);
}
Laravel 中,在 config/app.php
\RealPage\Builder\BuilderServiceProvider::class,
-
将
npm
和composer
容器(找到 DockerHub 上的 最新容器)添加到你的docker-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
使用方法
由于 compose 包的存在,您可以直接运行 php artisan builder:composer install
而不是 docker run -i -v $(pwd):/var/www/html realpage/builder composer install
。
可用的命令
$ 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