Skip to content

refactor(docker): consolidate Dockerfile.frontend into main multi-stage build - #851

Merged
LucasSantana-Dev merged 2 commits into
release/v2.11.0from
refactor/dockerfile-frontend-consolidation
May 14, 2026
Merged

LucasSantana-Dev merged 2 commits into
release/v2.11.0from
refactor/dockerfile-frontend-consolidation

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented May 14, 2026 •

Copy link
Copy Markdown
Owner

Consolidates Dockerfile.frontend into the main Dockerfile as a production-frontend target.

ADR supersession is included as a follow-up commit.

Summary by CodeRabbit

Release Notes

  • Refactor

    • Consolidated frontend Docker image build configuration into a unified multi-stage build process, eliminating the need for a separate build configuration.
  • Documentation

    • Updated Docker build documentation and added architectural decision record documenting the consolidation.
  • Chores

    • Updated continuous integration workflow and deployment configuration to use new build targets.

@vercel

vercel Bot commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment May 14, 2026 7:04pm

Request Review

@greptile-apps greptile-apps 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.

LucasSantana-Dev has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@coderabbitai

coderabbitai Bot commented May 14, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@LucasSantana-Dev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 41 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32034cca-41ed-46e4-84cf-1c06ed22542d

📥 Commits

Reviewing files that changed from the base of the PR and between 8e789aa and 99808f9.

📒 Files selected for processing (1)
  • Dockerfile
📝 Walkthrough

Walkthrough

This PR consolidates the separate Dockerfile.frontend into the main Dockerfile by introducing build-frontend and production-frontend build stages, updates CI and docker-compose to target the new stages, removes the now-redundant frontend Dockerfile, and documents the change with an ADR.

Changes

Frontend Docker Consolidation

Layer / File(s) Summary
Multi-stage Dockerfile restructuring
Dockerfile
New build-frontend stage reuses the existing build stage toolchain, copies packages/frontend, and runs the frontend workspace build. New production-frontend stage uses nginxinc/nginx-unprivileged:1.27-alpine, copies built frontend assets into nginx's document root, wires nginx/frontend.conf, exposes port 8080, adds an HTTP healthcheck for /, and runs nginx in the foreground.
CI and orchestration configuration
.github/workflows/docker-publish.yml, docker-compose.yml
Docker publish workflow matrix entry for frontend updated to use the main Dockerfile with target: production-frontend instead of Dockerfile.frontend. Docker Compose frontend service build configuration updated to reference the consolidated Dockerfile and the new production-frontend target. Standalone Dockerfile.frontend deleted.
Documentation and decision record
docs/DOCKER.md, docs/decisions/2026-05-13-frontend-dockerfile-consolidated.md
DOCKER.md table updated to document the multi-target build command for the Frontend (production) image. New ADR records the consolidation rationale, consequences (cache invalidation scope, deployment-target coupling), alternatives considered, and revisit criteria.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • LucasSantana-Dev/Lucky#848: Earlier changes to switch frontend Dockerfile to use nginxinc/nginx-unprivileged, port 8080, and HTTP healthchecks; this PR consolidates those structures into the main Dockerfile.
  • LucasSantana-Dev/Lucky#850: Adjusts frontend container runtime setup (Nginx upstream/healthcheck behavior and nginx/frontend.conf); this PR consolidates the same frontend deployment surface.
  • LucasSantana-Dev/Lucky#652: Earlier addition of shared build dependency preparation in Dockerfile.frontend; this PR consolidates frontend build dependencies into the main Dockerfile stages.

Suggested labels

frontend, infra

🚥 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 The title clearly and concisely summarizes the main change: consolidating Dockerfile.frontend into the main multi-stage Dockerfile, which is the primary objective across all file modifications in this changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/dockerfile-frontend-consolidation

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 and usage tips.

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@Dockerfile`:
- Around line 177-178: The HEALTHCHECK using wget fails because wget isn’t
present in the nginxinc/nginx-unprivileged:1.27-alpine image; replace that
command with a shell-native check (e.g., use /dev/tcp to attempt connecting to
127.0.0.1:8080) or switch to a process check that verifies nginx is running
(e.g., test for the master process or pid file) in the HEALTHCHECK instruction;
update the existing HEALTHCHECK line so it uses a POSIX shell builtin or process
inspection instead of wget, keeping the same --interval/--timeout/--retries
flags.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 520c6b7c-32fe-465b-9e72-1ebfd59073af

📥 Commits

Reviewing files that changed from the base of the PR and between a44c3ef and 8e789aa.

📒 Files selected for processing (6)
  • .github/workflows/docker-publish.yml
  • Dockerfile
  • Dockerfile.frontend
  • docker-compose.yml
  • docs/DOCKER.md
  • docs/decisions/2026-05-13-frontend-dockerfile-consolidated.md
💤 Files with no reviewable changes (1)
  • Dockerfile.frontend

Comment thread Dockerfile Outdated

@greptile-apps greptile-apps 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.

LucasSantana-Dev has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@greptile-apps greptile-apps 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.

LucasSantana-Dev has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@LucasSantana-Dev
LucasSantana-Dev force-pushed the refactor/dockerfile-frontend-consolidation branch from b8b7ed6 to eaa4be8 Compare May 14, 2026 19:00
@github-actions github-actions Bot removed the ci label May 14, 2026

@greptile-apps greptile-apps 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.

LucasSantana-Dev has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions github-actions Bot added size/xs and removed size/m labels May 14, 2026
LucasSantana-Dev added a commit that referenced this pull request May 14, 2026
…split) (#853)

* docs(adr): research-and-decide outputs for Docker surface (3 ADRs)

Three linked decisions from `/research-and-decide` composite on chore/docker-overhaul:

1. `2026-05-13-frontend-dockerfile-keep-separate.md` — Keep separate (deferred
   consolidation). 12-month review trigger + 3 hard escalation triggers.

2. `2026-05-13-orchestration-stay-on-compose.md` — Stay on docker-compose v2.
   Explicit acknowledgement of docker.sock blast radius (per critic). 5 hard
   revisit triggers including 90-day observability-data checkpoint.

3. `2026-05-13-base-image-stay-on-alpine.md` — Flipped from Phase-1's
   recommendation (bookworm-slim). Critic surfaced that PR #846's root cause
   was prebuilt-binary availability for @discordjs/opus, not musl vs glibc.
   Migration would not have prevented the break.

Phase-1 research dispatched 3 parallel agents (general-purpose). Phase-2 critic
(Opus) stress-tested all three leaders + identified cross-decision interactions.
All revisit triggers are concrete + measurable.

Branch parks on docs/docker-decision-adrs because PR #848 is open against
release/v2.11.0 and feedback_no_pr_stacking_2026-05-09 limits to 1 PR per base.

* docs(adr): mark frontend-dockerfile-keep-separate as superseded by PR #851

@greptile-apps greptile-apps 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.

LucasSantana-Dev has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit 0f43f86 into release/v2.11.0 May 14, 2026
17 checks passed

This branch was successfully deployed

1 active deployment
Preview — 99808f94 Deployed May 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant