Skip to content

chore: フロントエンドのDocker Compose環境の構築#783

Merged
shio0418 merged 5 commits into
mainfrom
docker/front-docker-compose
Jul 6, 2026
Merged

chore: フロントエンドのDocker Compose環境の構築#783
shio0418 merged 5 commits into
mainfrom
docker/front-docker-compose

Conversation

@shio0418

@shio0418 shio0418 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

close #670

  • compose.yamlui / dashboard / caddy サービスを追加
  • Caddyfile を追加し、ui.localhost / dashboard.localhost / localhost でリバースプロキシを設定

Summary by CodeRabbit

  • 新機能
    • 逆プロキシとしてCaddyを追加し、ローカルで ui.localhost / dashboard.localhost / localhost の3つのアクセス経路を使い分け可能に。
    • /api/v1/* は共通のバックエンドへ自動転送。
    • localhost:3000 経由のルーティングを整理し、UI表示とAPIの切り分けがより分かりやすくなりました。

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8a81e227-6e91-42dd-adad-4e2509152777

📥 Commits

Reviewing files that changed from the base of the PR and between 89994c5 and bd4b6ce.

📒 Files selected for processing (1)
  • compose.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • compose.yaml

📝 Walkthrough

Walkthrough

Caddyfileに3つのサイトブロックとグローバルオプションが追加され、compose.yamlにcaddy、ui、dashboardサービスと関連ボリュームが追加された。/api/v1/*はbackendへ、それ以外は各フロントエンドへ振り分ける構成になっている。

Changes

フロントエンドDocker Compose環境構築

Layer / File(s) Summary
Caddyグローバル設定とルーティングブロック
Caddyfile
admin/auto_https無効化のグローバル設定を追加し、ui.localhost/dashboard.localhost/localhostの各ブロックで/api/v1/*をbackend:1323へ、それ以外をui:80/dashboard:80へリバースプロキシする設定を定義。
composeサービスとボリューム追加
compose.yaml
caddyサービス(3000:80公開、Caddyfileとcaddy_data/caddy_configのマウント)、ui/dashboardサービス(80をexpose、backendにdepends_on)を追加し、末尾にcaddy_data/caddy_configボリュームを定義。

Estimated code review effort: 2 (Simple) | ~10 minutes

関連Issue: #670
Suggested labels: enhancement, infra, docker

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルはフロントエンド向けのDocker Compose環境構築という主変更を的確に表しています。
Linked Issues check ✅ Passed ui/dashboardのDocker image追加と、/api/v1をbackendへ向けるCaddyプロキシ設定が行われており、要件を満たしています。
Out of Scope Changes check ✅ Passed 要件外の大きな変更は見当たらず、ComposeとCaddy設定の範囲内に収まっています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docker/front-docker-compose

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.48%. Comparing base (e5a3f39) to head (bd4b6ce).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #783      +/-   ##
==========================================
+ Coverage   72.42%   72.48%   +0.05%     
==========================================
  Files          43       43              
  Lines        3881     3881              
==========================================
+ Hits         2811     2813       +2     
+ Misses        908      907       -1     
+ Partials      162      161       -1     
Flag Coverage Δ
integration 72.48% <ø> (+0.05%) ⬆️
unit 72.48% <ø> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
compose.yaml (2)

3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

イメージタグの固定方針が一貫していません。

caddylatestdashboardmain(いずれも可変タグ)を使用していますが、ui はコミットハッシュ付きの preview-446-... タグにピン留めされています。再現性やロールバック容易性のため、タグ運用方針を統一することを推奨します。

Also applies to: 33-33, 41-41

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@compose.yaml` at line 3, The image tag usage is inconsistent across the
compose services: caddy uses a mutable latest tag while ui is pinned to a
commit-specific tag. Update the compose services referenced by caddy, dashboard,
and ui to follow one consistent tag strategy, and prefer pinned immutable tags
if the goal is reproducible deploys and easier rollbacks.

2-11: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

caddydepends_on がありません。

backenduidashboard への depends_on が設定されていないため、これらのコンテナ起動前に caddy が起動し、初回リクエストでプロキシ先に接続できない可能性があります。Caddy は再試行するため致命的ではありませんが、起動順序を明示した方が安定します。

♻️ 提案
   caddy:
     image: caddy:latest
     restart: unless-stopped
     ports:
       - "80:80"
     volumes:
       - ./Caddyfile:/etc/caddy/Caddyfile
       - caddy_data:/data
       - caddy_config:/config
+    depends_on:
+      - backend
+      - ui
+      - dashboard
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@compose.yaml` around lines 2 - 11, Add an explicit depends_on for the caddy
service so it starts after backend, ui, and dashboard are available; update the
compose.yaml caddy service definition and use the existing service names
backend, ui, and dashboard to keep startup order stable and avoid early proxy
failures on first requests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@compose.yaml`:
- Line 3: The image tag usage is inconsistent across the compose services: caddy
uses a mutable latest tag while ui is pinned to a commit-specific tag. Update
the compose services referenced by caddy, dashboard, and ui to follow one
consistent tag strategy, and prefer pinned immutable tags if the goal is
reproducible deploys and easier rollbacks.
- Around line 2-11: Add an explicit depends_on for the caddy service so it
starts after backend, ui, and dashboard are available; update the compose.yaml
caddy service definition and use the existing service names backend, ui, and
dashboard to keep startup order stable and avoid early proxy failures on first
requests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 99a7abc3-00eb-4420-85aa-d59b6ba89e23

📥 Commits

Reviewing files that changed from the base of the PR and between e5a3f39 and 89994c5.

📒 Files selected for processing (2)
  • Caddyfile
  • compose.yaml

@H1rono

H1rono commented Jul 5, 2026

Copy link
Copy Markdown
Member

ありがとうございます。見ます

@H1rono H1rono left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2個、お願いします。他は良さそうです

Comment thread compose.yaml Outdated
Comment thread compose.yaml Outdated
caddyのポート番号を変更し、`ui`のタグ指定をmainに変更

Co-authored-by: H1rono_K <54711422+H1rono@users.noreply.github.com>
@shio0418
shio0418 requested a review from H1rono July 5, 2026 22:55

@H1rono H1rono left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!

@shio0418
shio0418 merged commit 8ee79df into main Jul 6, 2026
15 checks passed
@shio0418
shio0418 deleted the docker/front-docker-compose branch July 6, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

フロントエンドのDocker Compose環境の構築

2 participants