Repository navigation
refactor: trim unused PHP extensions and build deps from the local Docker image / ローカルDockerイメージの不要な拡張とビルド依存を削除 - #606
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 目的
environment/local/docker/Dockerfileinstalled several PHP extensions(
bcmath,exif,gd,zip,intl) and their apt-devbuild headers thatnothing in this codebase actually uses, inflating the local dev image for no
benefit.
environment/local/docker/Dockerfileはbcmath/exif/gd/zip/intlといった拡張と、それらのビルド用apt
-devヘッダーをインストールしていましたが、このコードベースのどこからも使われていませんでした。メリットなくローカル開発用イメージを肥大化させていました。
What I have done / 実施内容
composer.jsononly requiresext-dom/ext-xmlapp/has zero usage ofgd/exif/zip/bcmath/nativeintlfunctions (the app's
symfony/intldependency is a pure-PHP package and does not need thenative ICU extension)
php -mon the running container thatdom/xml/xmlreader/xmlwriterarealready bundled by
php:8.2-fpm-bookwormwithout this Dockerfile installing thembcmath,exif,gd(and its--with-freetype --with-jpegconfigure step),zip,intlfromdocker-php-ext-install-devpackages:libpng-dev,libjpeg62-turbo-dev,libfreetype6-dev,libzip-dev,libicu-dev,libxml2-devpdo_mysql/mbstring(+libonig-dev) and the infra/dev-convenience packages(
nginx,ca-certificates,curl,tzdata,gettext-base,git,unzip)Test Results / テスト結果
docker compose build --no-cache app): succeedsphp -min the rebuilt container confirms the trimmed extensions are gone anddom/xml/mbstring/pdo_mysqlare presentGET /api/v1/heritages?page=1returns200through nginx + php-fpm + MySQL
php artisan test(full suite): 217 passed, no regressionsCloses #605