Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .nixpacks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[phases.setup]
nixPkgs = ["libvips", "postgresql"]

[phases.build]
cmds = ["bundle install"]
Comment on lines +4 to +5
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.

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

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ Please follow [Spree Quickstart guide](https://spreecommerce.org/docs/developer/
## Deployment

Please follow [Deployment guide](https://spreecommerce.org/docs/developer/deployment/render) to quickly deploy your production-ready Spree application.
## Deploy on Railway

Spree Starter can be deployed on Railway using the built-in Nixpacks support.

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

2. Click **New Project → Deploy from GitHub Repo**
3. Select this repository
4. Add a **PostgreSQL** plugin
5. Add a **Redis** plugin
6. Set environment variables:
- RAILS_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- RAILS_LOG_TO_STDOUT=true
- SECRET_KEY_BASE=(generate using `rails secret`)
7. Deploy 🚀

> Note: Sidekiq runs in the same service by default. For production workloads, you may create a separate Railway service running `bundle exec sidekiq`.

## Customizing

Expand Down
12 changes: 12 additions & 0 deletions railway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "bundle exec rails db:prepare && bundle exec rails server -b 0.0.0.0 -p $PORT",
"healthcheckPath": "/",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}