Skip to content

fix(dockerfile): build issue related to asserting existence of next public app url - #1644

Merged
icecrasher321 merged 1 commit into
stagingfrom
fix/dockerfile-nextpublicapp
Oct 15, 2025
Merged

fix(dockerfile): build issue related to asserting existence of next public app url#1644
icecrasher321 merged 1 commit into
stagingfrom
fix/dockerfile-nextpublicapp

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Build issue related to asserting existence of next public app url

Type of Change

  • Bug fix

Testing

Wil test in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Oct 15, 2025

Copy link
Copy Markdown

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

ProjectDeploymentPreviewCommentsUpdated (UTC)
docsReadyReadyPreviewCommentOct 15, 2025 9:25pm

@icecrasher321
icecrasher321 merged commit b2009fe into stagingOct 15, 2025
4 checks passed

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Greptile Overview

Summary

Fixed Docker build failure caused by missing NEXT_PUBLIC_APP_URL environment variable during the build stage. The build process requires this variable because next.config.ts accesses env.NEXT_PUBLIC_APP_URL, which triggers validation through @t3-oss/env-nextjs.

The fix follows the existing pattern established for DATABASE_URL by providing a dummy value during build time that runtime environments can override with actual values.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix follows the exact same pattern already established for DATABASE_URL in the same Dockerfile. It provides a dummy environment variable during build time that will be overridden at runtime. The approach is consistent, well-commented, and solves a critical build failure without introducing any new risks.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
docker/app.Dockerfile5/5Added NEXT_PUBLIC_APP_URL dummy env var for build-time to prevent validation errors in next.config.ts

Sequence Diagram

sequenceDiagram
participant Docker as Docker Build
participant Dockerfile as app.Dockerfile
participant NextJS as Next.js Build
participant EnvSchema as env.ts (t3-oss)
participant NextConfig as next.config.ts
Docker->>Dockerfile: Start build stage
Dockerfile->>Dockerfile: Set DATABASE_URL dummy
Dockerfile->>Dockerfile: Set NEXT_PUBLIC_APP_URL dummy
Dockerfile->>NextJS: Run `bun run build`
NextJS->>NextConfig: Load next.config.ts
NextConfig->>EnvSchema: Import env (triggers validation)
EnvSchema->>EnvSchema: Validate NEXT_PUBLIC_APP_URL (required)
Note over EnvSchema: With fix: validates successfully<br/>Without fix: throws error
EnvSchema-->>NextConfig: Return validated env
NextConfig->>NextConfig: Access env.NEXT_PUBLIC_APP_URL (lines 85-93, 115)
NextConfig-->>NextJS: Return config
NextJS->>NextJS: Complete build
NextJS-->>Docker: Build artifacts ready
Loading

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
waleedlatif1 deleted the fix/dockerfile-nextpublicapp branch October 30, 2025 06:22
Sign up for freeto 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

@icecrasher321