Skip to content

Added Dockerfile#156

Merged
damianlegawiec merged 3 commits into
mainfrom
feature/dockerfile
May 21, 2026
Merged

Added Dockerfile#156
damianlegawiec merged 3 commits into
mainfrom
feature/dockerfile

Conversation

@damianlegawiec
Copy link
Copy Markdown
Member

@damianlegawiec damianlegawiec commented May 21, 2026

Summary by CodeRabbit

  • Improvements

    • Footer now dynamically displays the current year.
  • Refactor

    • Year rendering extracted into a dedicated component for consistency.
  • Chores

    • Build and packaging configuration updated for standalone production builds and optimized container builds (no user-facing behavior changes).

Review Change Stack

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
storefront Ready Ready Preview, Comment May 21, 2026 1:27pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Warning

Rate limit exceeded

@damianlegawiec has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 5 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6edec2df-d11e-4efb-8551-570be194bd69

📥 Commits

Reviewing files that changed from the base of the PR and between 94de6eb and 32db279.

📒 Files selected for processing (1)
  • README.md

Walkthrough

This PR introduces Docker containerization for the Next.js storefront, configures the app for standalone output, and refactors the Footer to use an extracted CurrentYear component. The changes enable production-ready deployment via Docker while maintaining clean component separation.

Changes

Containerization and Component Refactoring

Layer / File(s) Summary
Next.js standalone output configuration
next.config.ts
Enables output: "standalone" to generate a self-contained Next.js application suitable for Docker containerization.
CurrentYear component extraction
src/components/layout/CurrentYear.tsx, src/components/layout/Footer.tsx
Extracts year-rendering logic from Footer into a new client-side CurrentYear component; Footer is updated to import and use it.
Docker multi-stage build and context
.dockerignore, Dockerfile
Multi-stage Dockerfile installs dependencies via deps stage, builds the app with Spree and optional Sentry configuration in builder stage, and creates a minimal production image in runner stage with a non-root user and port 3001 exposure. .dockerignore excludes node_modules, build artifacts, environment files, and repository metadata from the build context.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 Docker dreams and components clean,
Standalone output built serene,
CurrentYear hops its way,
Container born this day! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title only mentions the Dockerfile, but the changeset includes multiple significant additions: .dockerignore, Dockerfile, next.config.ts modifications, and new UI components (CurrentYear component and Footer updates). Update the title to reflect the primary change more comprehensively, such as 'Add Docker containerization and refactor footer year display' or focus on the main objective if one change is more critical than others.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 feature/dockerfile

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/components/layout/Footer.tsx (1)

6-6: ⚡ Quick win

Use alias import instead of relative import.

Line 6 should use the @/ alias for consistency with repository import rules.

Suggested change
-import { CurrentYear } from "./CurrentYear";
+import { CurrentYear } from "`@/components/layout/CurrentYear`";

As per coding guidelines, "Use absolute imports with @/ alias prefix instead of relative imports."

🤖 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 `@src/components/layout/Footer.tsx` at line 6, Replace the relative import of
CurrentYear in Footer.tsx with the project alias import; change the import
statement that references "./CurrentYear" to use
"`@/components/layout/CurrentYear`" so Footer.tsx imports CurrentYear via the `@/`
alias for consistency with repo import rules.
src/components/layout/CurrentYear.tsx (2)

1-4: ⚡ Quick win

Remove unnecessary client boundary from CurrentYear.

CurrentYear doesn’t use hooks, event handlers, or browser-only APIs, so "use client" adds avoidable client JS for a server-safe value.

Suggested change
-"use client";
-
 export function CurrentYear() {
   return <>{new Date().getFullYear()}</>;
 }

As per coding guidelines, "Use Server Components by default. Only add 'use client' when you need event handlers, hooks like useState/useReducer/useEffect/useContext, browser-only APIs, or custom hooks that use state/effects."

🤖 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 `@src/components/layout/CurrentYear.tsx` around lines 1 - 4, The file
unnecessarily marks the CurrentYear component as a client component; remove the
"use client" directive at the top so the exported function CurrentYear remains a
server component (it only returns new Date().getFullYear() and uses no hooks,
event handlers, or browser-only APIs), ensuring no extra client-side bundle is
emitted.

3-3: ⚡ Quick win

Add an explicit return type for CurrentYear.

Line 3 should declare a return type to comply with strict TypeScript rules.

Suggested change
-export function CurrentYear() {
+export function CurrentYear(): JSX.Element {
   return <>{new Date().getFullYear()}</>;
 }

As per coding guidelines, "Use strict TypeScript type checking. Always define explicit return types for functions."

🤖 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 `@src/components/layout/CurrentYear.tsx` at line 3, The CurrentYear function
lacks an explicit TypeScript return type; update the function signature for
CurrentYear to include an explicit JSX return type (e.g., : JSX.Element or
React.ReactElement) so it satisfies strict TypeScript checking, and ensure any
imports/types used are available in the file (add import React if your tsconfig
requires it).
🤖 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 14-22: The Dockerfile currently exposes SENTRY_AUTH_TOKEN via
ARG/ENV (SENTRY_AUTH_TOKEN, SENTRY_DSN/SENTRY_ORG/SENTRY_PROJECT usage) which
can leak in image layers; change the build to use a BuildKit secret: stop
declaring SENTRY_AUTH_TOKEN as ARG/ENV in the Dockerfile, and instead read it
only during the build step with a secret mount (use --secret
id=sentry_auth_token) and a RUN that accesses the secret via the secret mount
(remove or replace any references that set SENTRY_AUTH_TOKEN in the image or
persist it in ENV), keeping other SENTRY_* non-sensitive args as ARGs if needed;
ensure the CI/build invocation supplies the secret via BuildKit rather than
passing it as --build-arg.

---

Nitpick comments:
In `@src/components/layout/CurrentYear.tsx`:
- Around line 1-4: The file unnecessarily marks the CurrentYear component as a
client component; remove the "use client" directive at the top so the exported
function CurrentYear remains a server component (it only returns new
Date().getFullYear() and uses no hooks, event handlers, or browser-only APIs),
ensuring no extra client-side bundle is emitted.
- Line 3: The CurrentYear function lacks an explicit TypeScript return type;
update the function signature for CurrentYear to include an explicit JSX return
type (e.g., : JSX.Element or React.ReactElement) so it satisfies strict
TypeScript checking, and ensure any imports/types used are available in the file
(add import React if your tsconfig requires it).

In `@src/components/layout/Footer.tsx`:
- Line 6: Replace the relative import of CurrentYear in Footer.tsx with the
project alias import; change the import statement that references
"./CurrentYear" to use "`@/components/layout/CurrentYear`" so Footer.tsx imports
CurrentYear via the `@/` alias for consistency with repo import rules.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28523d36-2774-477c-b6d2-0ca85c5e91ba

📥 Commits

Reviewing files that changed from the base of the PR and between 8b1ec90 and d8b3686.

📒 Files selected for processing (5)
  • .dockerignore
  • Dockerfile
  • next.config.ts
  • src/components/layout/CurrentYear.tsx
  • src/components/layout/Footer.tsx

Comment thread Dockerfile Outdated
@damianlegawiec damianlegawiec changed the title Added Deockerfile Added Dockerfile May 21, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Dockerfile (1)

95-97: 💤 Low value

Consider adding a HEALTHCHECK.

A HEALTHCHECK instruction helps orchestrators (Docker Swarm, some PaaS) detect unhealthy containers. Optional since Kubernetes typically defines probes externally.

♻️ Suggested addition
 EXPOSE 3001
+
+HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
+  CMD wget -qO- http://127.0.0.1:3001/ >/dev/null 2>&1 || exit 1

Note: wget is available in node:*-alpine by default via BusyBox.

🤖 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 `@Dockerfile` around lines 95 - 97, Add a Docker HEALTHCHECK to probe the app
endpoint so orchestrators can detect unhealthy containers; insert a HEALTHCHECK
after EXPOSE 3001 (before CMD ["node","server.js"]) that periodically curls or
wgets http://localhost:3001/ (or the app’s health path) with sensible interval,
timeout and retries, and make the command return non-zero on failure so Docker
marks the container unhealthy; reference HEALTHCHECK, EXPOSE, and CMD in the
Dockerfile when making the change.
🤖 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 `@Dockerfile`:
- Around line 95-97: Add a Docker HEALTHCHECK to probe the app endpoint so
orchestrators can detect unhealthy containers; insert a HEALTHCHECK after EXPOSE
3001 (before CMD ["node","server.js"]) that periodically curls or wgets
http://localhost:3001/ (or the app’s health path) with sensible interval,
timeout and retries, and make the command return non-zero on failure so Docker
marks the container unhealthy; reference HEALTHCHECK, EXPOSE, and CMD in the
Dockerfile when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: db59e1a3-2d11-49f3-b840-5381ba6dfb53

📥 Commits

Reviewing files that changed from the base of the PR and between d8b3686 and 94de6eb.

📒 Files selected for processing (1)
  • Dockerfile

@damianlegawiec damianlegawiec merged commit 36ce7f2 into main May 21, 2026
6 checks passed
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.

1 participant