feat: PVCルートを /var/www にマウント、/composer を使い捨て領域に変更 (v8.5.6-e)
Helm Chart Release / release-chart (push) Successful in 6s

php-fpm コンテナのマウントを html サブパスのみから PVCルート
(/var/www)に変更。html/ は公開フォルダ、それ以外は非公開ファイル
の格納先として利用可能に。nginx は従来どおり html サブパスのみ
マウントするため、非公開ディレクトリがWebに公開されることはない。

あわせて /composer のPVC永続化マウントを廃止し、Pod再起動ごとに
クリーン再構築される使い捨て領域とした(マルウェア書き込み対策)。
永続化したい場合は composer.workingDir に /var/www/composer 等を指定。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 17:03:16 +09:00
co-authored by Claude Fable 5
parent be1c82e968
commit 85b7f69ccb
6 changed files with 71 additions and 14 deletions
+6 -9
View File
@@ -200,16 +200,13 @@ spec:
ports:
- containerPort: 9000 # PHP-FPMは9000ポートでリッスン
volumeMounts:
# PVCルートを /var/www にマウント
# - /var/www/html のみ nginx が公開(nginx側は html サブパスだけをマウント)
# - それ以外(/var/www/<任意>)は非公開ファイルの格納先として利用可能
# ※ Composer導入先(デフォルト /composer)は意図的にマウントしない:
# Pod再起動のたびにクリーンな環境へ再構築される使い捨て領域とする
- name: app-storage
mountPath: /var/www/html
subPath: html
{{- $composerDir := .Values.composer.workingDir | default "/composer" }}
{{- if and (or .Values.composer.enabled .Values.selenium.enabled) (ne $composerDir "/var/www/html") }}
# Composer導入先をPVCに永続化(Pod再起動時のvendor再構築を回避)
- name: app-storage
mountPath: {{ $composerDir }}
subPath: composer
{{- end }}
mountPath: /var/www
{{- if and .Values.composer.enabled .Values.composer.useComposerJson }}
- name: composer-config
mountPath: /tmp/composer-init