feat: Composer導入先をWebルート外(/var/www)に変更 (v8.5.6-a)
Helm Chart Release / release-chart (push) Successful in 5s

従来はWebルート /var/www/html 直下にComposerを導入していたため、
composer.json / composer.lock / vendor/ がWeb経由で公開され、
依存パッケージ情報の漏洩などのセキュリティリスクがあった。

- values.yaml: composer.workingDir を追加(デフォルト: /var/www)
- templates/deployment.yaml: 作業ディレクトリを workingDir に変更、
  Webルート以外の場合はPVCの composer サブパスをマウントして永続化
- README.md: パラメータ説明・autoload読み込みパスの解説を追加
- Chart.yaml: 8.5.6-a(手動リリース)
- CHANGELOG-8.5.6-a.md: 変更内容を記録

PHP側は require_once '/var/www/vendor/autoload.php'; で読み込む。
旧動作へは composer.workingDir: "/var/www/html" で復帰可能。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 14:29:23 +09:00
co-authored by Claude Fable 5
parent 112fae7059
commit 8ff43615fa
6 changed files with 91 additions and 5 deletions
+11 -2
View File
@@ -106,8 +106,10 @@ spec:
{{- if or .Values.composer.enabled .Values.selenium.enabled }}
echo "Installing Composer..."
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
cd /var/www/html
# Composer導入先(デフォルトはWebルート外の /var/www
mkdir -p {{ .Values.composer.workingDir | default "/var/www" }}
cd {{ .Values.composer.workingDir | default "/var/www" }}
{{- if .Values.composer.enabled }}
# ユーザー定義のComposer設定
@@ -190,6 +192,13 @@ spec:
- name: app-storage
mountPath: /var/www/html
subPath: html
{{- $composerDir := .Values.composer.workingDir | default "/var/www" }}
{{- 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 }}
{{- if and .Values.composer.enabled .Values.composer.useComposerJson }}
- name: composer-config
mountPath: /tmp/composer-init