-
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?
Changes from all commits
2c403db
dae6111
8dbae5f
4d60104
8708470
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [phases.setup] | ||
| nixPkgs = ["libvips", "postgresql"] | ||
|
|
||
| [phases.build] | ||
| cmds = ["bundle install"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Missing asset precompilation in Nixpacks build phaseThe |
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.18.1)39-39: Bare URL used (MD034, no-bare-urls) 🤖 Prompt for AI Agents |
||||||
| 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 | ||||||
|
|
||||||
|
|
||||||
| 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 | ||
| } | ||
| } |
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 installbut doesn't precompile assets. Since the README instructions setRAILS_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:
📝 Committable suggestion
🤖 Prompt for AI Agents