Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cbdf29c
php8.1対応
atsu666 Dec 8, 2021
989f269
redis拡張を導入
atsu666 Dec 11, 2021
6a95dc0
xdebugを削除
atsu666 May 19, 2022
a784749
mod: headers, mime, expires, deflate を有効化
atsu666 Jul 6, 2022
2012741
再起動すると、ドキュメントルートがずれる問題を修正
atsu666 Feb 9, 2022
3ab2ffd
apple silicon (arm64) に対応
atsu666 Dec 22, 2022
5faa385
linux/amd64のイメージを持ってくるように修正
atsu666 Dec 22, 2022
783a41c
調整
atsu666 Dec 22, 2022
fd78f9e
PHP8.2対応
uidev1116 Feb 19, 2024
95b18d0
php8.3対応
uidev1116 Feb 19, 2024
44dbcc8
単一ブランチ + docker-bake 構成へ刷新し PHP 8.0-8.5 に対応
uidev1116 Jul 2, 2026
6f2deef
環境変数の ACMS_ プレフィックスを廃止(XDEBUG / PUID / PGID)
uidev1116 Jul 2, 2026
617961b
PHP 7.2/7.3/7.4 を追加し、README から同梱版イメージの記述を削除
uidev1116 Jul 3, 2026
ccee6a4
Update README to clarify that the images are for development use
uidev1116 Jul 3, 2026
4d0a37f
latest タグを 8.5 に変更(PHP_LATEST=8.5)
uidev1116 Jul 3, 2026
3bf7b0b
master をマージ(衝突は新構成側を採用。redis 等は新 Dockerfile に包含済み)
uidev1116 Jul 3, 2026
4837260
PR プレビューを高速化(amd64・バージョン別 matrix 並列)+ リポジトリ名を整合
uidev1116 Jul 3, 2026
5758413
build.yml も matrix 並列化し、CI のジョブ表示名をドット付きに
uidev1116 Jul 3, 2026
23eaa06
usermod -u によるマウント先プロジェクトの意図しない再帰chownを修正
uidev1116 Jul 3, 2026
982f2de
リポジトリから .claude/ 設定を除外(誤コミットの修正)
uidev1116 Jul 3, 2026
d1d842f
コードレビュー指摘15件に対応(CI堅牢化・DocumentRoot冪等化・PID1化・ビルド軽量化ほか)
uidev1116 Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# GitHub Actions の更新を自動追従する(週次)。
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 20
groups:
github-actions:
update-types:
- minor
- patch
98 changes: 98 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# master への push / 週次 / 手動実行で Docker Hub (appleple) へマルチアーキ公開する。
# ビルド対象バージョンは docker-bake.hcl の PHP_VERSIONS が単一の真実の源。
# PR のプレビュービルドは pr-preview.yml(GHCR)が担当する。
#
# 必要な Secrets: DOCKERHUB_USERNAME / DOCKERHUB_TOKEN
# Actions は commit SHA でピン留め(サプライチェーン対策)。更新は dependabot。
# PHP バージョンごとに matrix で並列(各ジョブが amd64+arm64 を担当)。
name: Build and publish images

on:
push:
branches:
- master
paths:
- 'Dockerfile'
- 'entrypoint.sh'
- 'config/**'
- 'docker-bake.hcl'
- '.github/workflows/build.yml'
workflow_dispatch:
# 毎週日曜 00:00 UTC。ベースイメージのセキュリティ更新を取り込む定期ビルド。
schedule:
- cron: '0 0 * * 0'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
prepare:
name: Resolve build matrix
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Resolve targets from docker-bake.hcl
id: gen
shell: bash
run: |
set -euo pipefail
matrix="$(docker buildx bake --print | jq -c '{include: [.target | to_entries[] | {version: .value.args.PHP_VERSION, target: .key}]}')"
if [ -z "$matrix" ] || [ "$matrix" = "null" ]; then
echo "::error::failed to resolve bake targets from docker-bake.hcl"
exit 1
fi
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"

build:
name: acms-dev:${{ matrix.version }}
needs: prepare
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}

steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Login to Docker Hub
uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push (multi-arch)
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
with:
source: .
targets: ${{ matrix.target }}
push: true
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,mode=max,scope=${{ matrix.target }}
*.attest=type=provenance,mode=max
*.attest=type=sbom
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# GitHub Actions ワークフローの静的検査(actionlint)。YAML/式/シェルの事故を防ぐ。
name: Lint workflows

on:
pull_request:
paths:
- '.github/workflows/**'
push:
branches:
- master
paths:
- '.github/workflows/**'

permissions: {}

jobs:
actionlint:
name: actionlint
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Run actionlint
uses: reviewdog/action-actionlint@be0761e4c1bab7cfdfca56cd03d4bb6253e39a4a # v1.72.0
with:
reporter: github-check
62 changes: 62 additions & 0 deletions .github/workflows/pr-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# PR がクローズ(マージ/却下いずれも)されたら、pr-preview.yml が GHCR に
# 公開したプレビュータグ(acms-dev:<ver>-<PR番号>)を削除する。
#
# 注意: GITHUB_TOKEN では GHCR パッケージの削除ができない
# (GitHub の仕様。delete:packages スコープを持つ PAT が必要)。
# そのため Secrets に GHCR_DELETE_TOKEN(delete:packages, read:packages)を
# 設定するまでは、このジョブは警告を出して安全にスキップする。
name: Clean up PR preview images

on:
pull_request:
types: [closed]

permissions: {}

jobs:
cleanup:
name: Delete GHCR preview tags
runs-on: ubuntu-latest
permissions:
contents: read
env:
PR_NUMBER: ${{ github.event.number }}
PACKAGE_NAME: acms-dev
OWNER: ${{ github.repository_owner }}

steps:
- name: Check for GHCR_DELETE_TOKEN
id: check
shell: bash
run: |
if [ -n "${{ secrets.GHCR_DELETE_TOKEN }}" ]; then
echo "has_token=true" >> "$GITHUB_OUTPUT"
else
echo "has_token=false" >> "$GITHUB_OUTPUT"
echo "::warning::GHCR_DELETE_TOKEN が未設定のため、PR プレビューイメージの自動削除をスキップしました。ghcr.io/${OWNER}/<repo>/${PACKAGE_NAME} の '-${PR_NUMBER}' サフィックスのタグは手動削除するか、delete:packages 権限を持つ PAT を GHCR_DELETE_TOKEN に設定してください。"
fi

- name: Delete preview versions
if: steps.check.outputs.has_token == 'true'
shell: bash
env:
GH_TOKEN: ${{ secrets.GHCR_DELETE_TOKEN }}
run: |
set -euo pipefail
suffix="-${PR_NUMBER}"
echo "Package ${PACKAGE_NAME} のバージョンから suffix '${suffix}' を検索します..."

ids="$(gh api --paginate "/orgs/${OWNER}/packages/container/${PACKAGE_NAME}/versions" \
| jq -s 'add' \
| jq -r --arg suffix "$suffix" \
'.[] | select((.metadata.container.tags // []) | any(endswith($suffix))) | .id')"

if [ -z "$ids" ]; then
echo "削除対象のタグは見つかりませんでした。"
exit 0
fi

echo "$ids" | while read -r id; do
echo "Deleting version id=${id}"
gh api --method DELETE "/orgs/${OWNER}/packages/container/${PACKAGE_NAME}/versions/${id}"
done
99 changes: 99 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Pull Request ごとに GHCR へプレビューイメージを公開する(レビュアーが pull 可能)。
# タグ例: ghcr.io/<owner>/<repo>/acms-dev:8.5-<PR番号>
#
# 速度重視の構成:
# - PR では amd64 のみ(QEMU エミュレーションを使わない)。arm64 は本番 build.yml で。
# - PHP バージョンごとに matrix で別 runner に分散(並列)。
# - 対象バージョンは docker-bake.hcl から動的取得(二重管理しない)。
# フォークからの PR は GITHUB_TOKEN に packages:write が無いため、ビルド検証のみ。
name: Build preview images (PR)

on:
pull_request:
paths:
- 'Dockerfile'
- 'entrypoint.sh'
- 'config/**'
- 'docker-bake.hcl'
- '.github/workflows/pr-preview.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

permissions: {}

jobs:
prepare:
name: Resolve build matrix
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Resolve targets from docker-bake.hcl
id: gen
shell: bash
run: |
set -euo pipefail
matrix="$(docker buildx bake --print | jq -c '{include: [.target | to_entries[] | {version: .value.args.PHP_VERSION, target: .key}]}')"
if [ -z "$matrix" ] || [ "$matrix" = "null" ]; then
echo "::error::failed to resolve bake targets from docker-bake.hcl"
exit 1
fi
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"

build:
name: acms-dev:${{ matrix.version }} (amd64)
needs: prepare
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
env:
# 同一リポジトリの PR のみ GHCR へ push(フォークは検証のみ)
IS_INTERNAL: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
# bake の HCL 変数は同名の環境変数で上書きできる。
# GHCR 名前空間はリポジトリ名に自動追従(改名にも強い)
REGISTRY: ghcr.io/${{ github.repository }}
PR_TAG: -${{ github.event.number }}

steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0

- name: Login to GHCR
if: ${{ env.IS_INTERNAL == 'true' }}
uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build (amd64; push preview when internal)
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
with:
source: .
targets: ${{ matrix.target }}
push: ${{ env.IS_INTERNAL == 'true' }}
set: |
*.platform=linux/amd64
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,mode=max,scope=${{ matrix.target }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
.DS_Store
docs
.claude/
Loading
Loading