feat(php): pre-warm Composer cache with common dependencies
Installs laravel/framework, livewire, pint, pest, and testbench into the Composer cache during build. CI jobs hit local cache instead of downloading ~48MB of packages per run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cb3a6d42ec
commit
cba829fbdd
1 changed files with 11 additions and 0 deletions
|
|
@ -12,5 +12,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||
# Composer
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# Pre-warm Composer cache with common dependencies across all core/php-* repos.
|
||||
# This means `composer install` in CI hits local cache instead of downloading.
|
||||
RUN mkdir /tmp/warmup && cd /tmp/warmup \
|
||||
&& composer init --name=lthn/warmup --no-interaction \
|
||||
&& composer config allow-plugins.pestphp/pest-plugin true \
|
||||
&& composer config allow-plugins.phpstan/extension-installer true \
|
||||
&& composer require --no-interaction --prefer-dist \
|
||||
laravel/framework livewire/livewire \
|
||||
laravel/pint pestphp/pest orchestra/testbench \
|
||||
&& rm -rf /tmp/warmup
|
||||
|
||||
# Verify
|
||||
RUN php -v && composer --version
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue