Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Dummy DB URL needed to build and push image.

@icecrasher321 icecrasher321 merged commit 6028b1f into staging Sep 18, 2025
2 of 5 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR addresses a Docker build failure by adding dummy database environment variables to the app.Dockerfile. The change introduces DATABASE_URL and POSTGRES_URL environment variables with dummy PostgreSQL connection strings during the Docker build stage.

The implementation uses ARG directives with default dummy values (postgresql://user:pass@localhost:5432/dummy) that can be overridden at build time, then exposes them as ENV variables. This pattern is positioned strategically just before the bun run build command in the builder stage.

The root cause being addressed is that Next.js build processes often perform static analysis and code evaluation that can trigger imports of database modules (like @sim/db). When these modules are loaded, they typically expect database connection environment variables to be present and valid, even though no actual database connection occurs during the build phase. Without these variables, the build process would crash.

This solution follows a common Docker pattern for handling build-time dependencies that require environment variables without affecting runtime behavior. The variables are only present in the builder stage and won't be inherited by the runner stage, ensuring clean separation between build and runtime environments.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it addresses a specific build failure without affecting runtime behavior
  • Score reflects a targeted fix for a common Docker build issue using established patterns, though the dummy URLs could potentially mask real configuration issues in development
  • Pay close attention to ensuring runtime environments properly override these dummy values with real database connections

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@vercel
Copy link

vercel bot commented Sep 18, 2025

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

Project Deployment Preview Comments Updated (UTC)
sim Building Building Preview Comment Sep 18, 2025 1:59am

Acumen-Desktop pushed a commit to Acumen-Desktop/sim that referenced this pull request Sep 20, 2025
@waleedlatif1 waleedlatif1 deleted the fix/dockerfile-build branch October 7, 2025 23:22
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.

2 participants