Skip to content

Conversation

@Aditya41150
Copy link

@Aditya41150 Aditya41150 commented Dec 16, 2025

This PR adds first-class support for deploying Spree Starter on Railway using
Railway’s native Nixpacks flow.

Changes include:

  • Railway deployment configuration (railway.json)
  • Nixpacks system dependencies (libvips)
  • Documentation for deploying with PostgreSQL and Redis on Railway

This does not affect existing deployment paths and is fully optional.


Note

Adds Railway deployment via Nixpacks with config, system deps, and setup docs.

  • Deployment
    • Add Railway config in railway.json using Nixpacks builder and deploy settings (start command, healthcheck, restart policy).
    • Introduce Nixpacks config .nixpacks.toml with system packages (libvips, postgresql) and build step (bundle install).
  • Documentation
    • Add "Deploy on Railway" guide in README.md with 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

    • Added step-by-step "Deploy on Railway" instructions under Deployment, including a note about background job processing; duplicate insertions were also included in the update.
  • Chores

    • Added Railway deployment configuration and automated build/deploy settings to enable streamlined deployment and service startup.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Note

Other AI code review bot(s) detected

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

Walkthrough

Adds Railway deployment configs and README deployment instructions: a new .nixpacks.toml declaring setup and build phases, a railway.json manifest for Nixpacks deployment, and duplicated "Deploy on Railway" content added to README.md.

Changes

Cohort / File(s) Summary
Railway / Nixpacks configs
./.nixpacks.toml, ./railway.json
New deployment files: .nixpacks.toml installs libvips and postgresql in setup and runs bundle install in build; railway.json declares NIXPACKS build, startCommand, healthcheckPath, and restart policy.
Documentation
./README.md
Added "Deploy on Railway" section with step-by-step deployment instructions and a Sidekiq note; the section appears duplicated in the diff.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify .nixpacks.toml lists exact package names and intended phases/commands.
  • Confirm railway.json startCommand, healthcheckPath, and restart policy match app expectations.
  • Remove or reconcile the duplicated "Deploy on Railway" section in README.md.

Poem

🐰 I hopped through configs, tidy and merry,
Nixpacks packed my carrot and berry,
Railway tracks hum a gentle tune,
Bundled gems beneath the moon,
Off we go — deploy! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding Railway deployment configuration and Nixpacks support files with accompanying documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d60104 and 8708470.

📒 Files selected for processing (2)
  • .nixpacks.toml (1 hunks)
  • railway.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • railway.json
  • .nixpacks.toml
⏰ 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

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

@cursor cursor bot left a 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.

Copy link

@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: 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., /health or /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_URL and REDIS_URL are 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

📥 Commits

Reviewing files that changed from the base of the PR and between 0eeb5eb and 4d60104.

📒 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 startCommand in railway.json takes precedence over this Nixpacks start phase. Currently, railway.json lacks the rails db:prepare step, 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.

Comment on lines +4 to +5
[phases.build]
cmds = ["bundle install"]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

Suggested change
[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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
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.

@Aditya41150
Copy link
Author

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"]
Copy link

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.

Fix in Cursor Fix in Web

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