feat: add Dockerfiles and image build CI for frontend/backend - #132
Merged
Conversation
api/worker/frontend をそれぞれコンテナ化し、GHCRへイメージをpushするCIワークフローを追加。 Next.jsのstandaloneビルドに対応するためpnpmバージョンを固定し、ビルドスクリプト承認設定を追加。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
crates/api(boardflow-api) /crates/worker(boardflow-worker) /boardflow(フロントエンド)をそれぞれコンテナ化ghcr.io/f0reacharr/boardflow-{api,worker,frontend}) にビルド・pushするCIワークフローを追加(action-image.ymlと同じ構成: PRではbuildのみ、main/tagsへのpushでpush)Details
crates/api/Dockerfile,crates/worker/Dockerfile:action/Dockerfileと同じ cargo-chef 多段ビルドパターンを踏襲。ランタイムはdebian:bookworm-slim+ca-certificates+libssl3(reqwest/native-tls依存のため)、非rootユーザーで実行boardflow/Dockerfile: pnpm install →next build→ standalone runtime の3段構成。next.config.tsにoutput: 'standalone'を追加boardflow/package.json:packageManager: pnpm@10.33.2を固定(mise.tomlの pnpm バージョンと不一致だと corepack が pnpm 11 系を落としてきてERR_PNPM_IGNORED_BUILDSで落ちたため)。pnpm.onlyBuiltDependencies: ["sharp"]を追加してビルドスクリプトを許可.dockerignore(ルート・boardflow/)を追加してビルドコンテキストを削減.github/workflows/backend-image.yml:matrixで api/worker を並列ビルド、GHAキャッシュはサービスごとにスコープ分離.github/workflows/frontend-image.yml:boardflow/配下の変更をトリガーにビルドTest plan
docker build -f boardflow/Dockerfile boardflow→ ビルド成功、コンテナ起動して/loginにHTTP 200を確認docker build -f crates/api/Dockerfile .→ ビルド成功、docker-composeの postgres と接続して/api/v1/openapi.jsonにHTTP 200を確認docker build -f crates/worker/Dockerfile .→ ビルド成功🤖 Generated with Claude Code