-
Notifications
You must be signed in to change notification settings - Fork 242
Add Railway deployment guide and Nixpacks support #1295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds Railway deployment configs and README deployment instructions: a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
railway.json (1)
8-8: Consider a dedicated health check endpoint.Using
"/"as the healthcheck path means Railway will hit the home page. If the application has a lightweight health endpoint (e.g.,/healthor/up), it would provide faster, more reliable health checks without loading the full storefront.README.md (1)
44-48: Clarify which environment variables are auto-injected.Consider adding a note that
DATABASE_URLandREDIS_URLare automatically set by Railway when you add the PostgreSQL and Redis plugins, so users don't need to configure them manually.Example addition:
6. Set environment variables: - RAILS_ENV=production - RAILS_SERVE_STATIC_FILES=true - RAILS_LOG_TO_STDOUT=true - SECRET_KEY_BASE=(generate using `rails secret`) + + Note: DATABASE_URL and REDIS_URL are automatically configured by Railway when you add the PostgreSQL and Redis plugins.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.nixpacks.toml(1 hunks)README.md(1 hunks)railway.json(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
README.md
39-39: Bare URL used
(MD034, no-bare-urls)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cursor Bugbot
🔇 Additional comments (2)
.nixpacks.toml (1)
7-8: Note: This start command is overridden by railway.json.The
startCommandinrailway.jsontakes precedence over this Nixpacks start phase. Currently,railway.jsonlacks therails db:preparestep, which will cause deployment issues. This has been flagged separately in the railway.json review.Consider whether both configurations are needed, or if the start command should be consolidated into one location for maintainability.
README.md (1)
51-51: Good practice: Sidekiq deployment note.The note about Sidekiq running in the same service is helpful, and the suggestion to create a separate service for production workloads follows Railway best practices.
| [phases.build] | ||
| cmds = ["bundle install"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add asset precompilation to the build phase.
The build phase only runs bundle install but doesn't precompile assets. Since the README instructions set RAILS_SERVE_STATIC_FILES=true, Rails will serve static assets directly, which requires them to be precompiled during the build.
Apply this diff to add asset precompilation:
[phases.build]
-cmds = ["bundle install"]
+cmds = ["bundle install", "bundle exec rails assets:precompile"]📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| [phases.build] | |
| cmds = ["bundle install"] | |
| [phases.build] | |
| cmds = ["bundle install", "bundle exec rails assets:precompile"] |
🤖 Prompt for AI Agents
In .nixpacks.toml around lines 4–5, the build phase only runs `bundle install`
and doesn't precompile Rails assets; update the build cmds so after installing
gems it runs the Rails asset precompilation in production (e.g. set
RAILS_ENV=production and run the appropriate command such as `bundle exec rails
assets:precompile` or `bundle exec rake assets:precompile`) so static files are
generated during build; ensure the cmds array runs bundle install first and then
the precompile step.
|
|
||
| ### Steps | ||
|
|
||
| 1. Go to https://railway.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the bare URL formatting.
The URL should be formatted as a proper Markdown link or enclosed in angle brackets to comply with Markdown best practices.
Apply this diff to fix the formatting:
-1. Go to https://railway.app
+1. Go to <https://railway.app>Based on static analysis hints from markdownlint-cli2.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| 1. Go to https://railway.app | |
| 1. Go to <https://railway.app> |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
39-39: Bare URL used
(MD034, no-bare-urls)
🤖 Prompt for AI Agents
In README.md around line 39, the bare URL "https://railway.app" should be
formatted as a proper Markdown link or enclosed in angle brackets; update the
line to use either markdown link syntax (e.g. [Railway](https://railway.app)) or
wrap the URL in angle brackets (<https://railway.app>) to satisfy markdownlint
rules and improve rendering.
|
Railway prioritizes startCommand from railway.json when present, so the db:prepare step in .nixpacks.toml would indeed be skipped. I’ve updated railway.json to include bundle exec rails db:prepare and removed the duplicate start phase from Nixpacks to ensure a single source of truth. |
| nixPkgs = ["libvips", "postgresql"] | ||
|
|
||
| [phases.build] | ||
| cmds = ["bundle install"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing asset precompilation in Nixpacks build phase
The [phases.build] section explicitly sets cmds = ["bundle install"], which overrides Nixpacks' default Rails build behavior that would normally include asset precompilation. All other deployment configurations in this repo (Dockerfile, bin/render-build.sh, CircleCI) explicitly run rails assets:precompile. Without this step, the production deployment will have missing or broken CSS/JavaScript assets, causing the application's frontend to fail.
This PR adds first-class support for deploying Spree Starter on Railway using
Railway’s native Nixpacks flow.
Changes include:
This does not affect existing deployment paths and is fully optional.
Note
Adds Railway deployment via Nixpacks with config, system deps, and setup docs.
railway.jsonusing Nixpacks builder and deploy settings (start command, healthcheck, restart policy)..nixpacks.tomlwith system packages (libvips,postgresql) and build step (bundle install).README.mdwith required plugins, env vars, and Sidekiq note.Written by Cursor Bugbot for commit 8708470. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.