/spree-commerce:spree-deploymentfrom spree-commerce
Deploys Spree to production with PostgreSQL, Redis, Sidekiq, Docker multi-arch images on GHCR, and platform targets (Heroku, Render, Fly.io, AWS). Covers env-var conventions, asset precompilation, Action Cable, MeiliSearch, S3/ActiveStorage, zero-downtime deploys, and migration strategy.
Ships in spree-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
spree-starter Dockerfile and docker-compose.yml for the current production stack.| Tier | Component |
|---|---|
| Web | Puma serving the Rails app (Spree API + admin) |
| Worker | Sidekiq processing background jobs |
| DB | PostgreSQL 14+ (recommended) or MySQL 8 |
| Cache + Jobs | Redis 7+ |
| Search | MeiliSearch (v5.4+) or Algolia or Postgres FTS |
| Media | S3-compatible (ActiveStorage) |
| SMTP (SendGrid, Postmark, SES) | |
| CDN | CloudFront, Cloudflare, or platform-native |
| Front-end (headless) | Vercel for Next.js storefront |
| Observability | Sentry, Datadog, New Relic, AppSignal |
Spree publishes multi-arch (ARM + x86) Docker images to GitHub Container Registry:
ghcr.io/spree/spree:5.4.2
ghcr.io/spree/spree-starter:latest
ghcr.io/spree/storefront:5.4.2
(Verify the exact image tags against the GHCR releases.)
spree-starter DockerfileThe starter ships a production-ready Dockerfile with:
bootsnap precompile for faster boot| Var | Purpose |
|---|---|
DATABASE_URL | postgres://user:pass@host:5432/db |
REDIS_URL | redis://host:6379/0 |
RAILS_ENV | production |
RAILS_MASTER_KEY | Decrypts config/credentials.yml.enc |
SECRET_KEY_BASE | If not in credentials |
RAILS_LOG_TO_STDOUT | true for containerized envs |
RAILS_SERVE_STATIC_FILES | true if no CDN in front |
WEB_CONCURRENCY | Puma worker count |
RAILS_MAX_THREADS | Threads per Puma worker |
MEILISEARCH_HOST, MEILISEARCH_API_KEY | Search backend |
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET, AWS_REGION | ActiveStorage S3 |
SMTP_* | |
SENTRY_DSN | Error tracking |
STRIPE_*, ADYEN_*, PAYPAL_* | Payment gateways |
SPREE_API_URL | (Storefront-side) backend URL |
NEXT_PUBLIC_SPREE_PUBLISHABLE_KEY | (Storefront-side) publishable key |
Spree v5 uses Propshaft + Tailwind CSS 4. In Dockerfile:
RUN bin/rails assets:precompile RAILS_ENV=production
For Tailwind, tailwindcss-rails watches files at runtime in dev; in production, precompile bakes the final CSS. If using esbuild, run bin/rails javascript:build too.
Run before traffic flips:
bin/rails db:migrate
For zero-downtime:
# config/initializers/sidekiq.rb
Sidekiq.configure_server do |config|
config.redis = { url: ENV['REDIS_URL'] }
end
Sidekiq.configure_client do |config|
config.redis = { url: ENV['REDIS_URL'] }
end
# config/sidekiq.yml
:concurrency: 10
:queues:
- critical
- default
- webhooks
- mailers
- low
Webhook delivery uses Sidekiq — without it, webhooks don't fire.
For real-time admin updates (e.g., live order list refresh), Action Cable runs on the same Puma process. Redis is the broadcast adapter.
After deploy:
bin/rails spree:search:reindex
(Verify the rake task name.) Run on a worker, not the web tier — long-running.
ActiveStorage::AnalyzeJob etc.; can fall behind on bulk uploadsconfig/credentials.yml.enc backed up alongside RAILS_MASTER_KEY (keep separate)heroku create my-spree
heroku addons:create heroku-postgresql:standard-0
heroku addons:create heroku-redis:premium-0
heroku addons:create sendgrid:starter
heroku buildpacks:add heroku/ruby
heroku buildpacks:add heroku/nodejs # for asset compilation
heroku config:set RAILS_MASTER_KEY=$(cat config/master.key)
heroku config:set RAILS_LOG_TO_STDOUT=true
heroku config:set RAILS_SERVE_STATIC_FILES=true
git push heroku main
heroku run bin/rails db:migrate
heroku run bin/rails spree:install
Run Sidekiq on a worker dyno:
heroku ps:scale web=2 worker=1
Procfile:
web: bundle exec puma -C config/puma.rb
worker: bundle exec sidekiq -C config/sidekiq.yml
release: bin/rails db:migrate
docker build -t spree:latest .
docker run -d --name spree-web \
-e DATABASE_URL=... \
-e REDIS_URL=... \
-e RAILS_MASTER_KEY=... \
-p 3000:3000 \
spree:latest
docker run -d --name spree-worker \
-e DATABASE_URL=... \
-e REDIS_URL=... \
-e RAILS_MASTER_KEY=... \
spree:latest bundle exec sidekiq
For Kubernetes, use separate Deployments for web and worker, plus a Job for db:migrate on each release.
Vercel:
Docker / self-hosted:
| Layer | What to cache |
|---|---|
| CDN | Static assets (/assets/*, /packs/*) |
| Rails fragment cache | Product cards on PLP (busted by product.updated) |
| Rails low-level cache | Computed totals, settings |
| Database query cache | Per-request (default Rails behavior) |
| Sidekiq result cache | Webhook delivery dedup |
SIGTSTP then SIGTERM)/admin/login_check or similar low-overhead path/api/v3/* separate from adminRAILS_MASTER_KEY not set — app crashes at boot with cryptic error.RAILS_SERVE_STATIC_FILES=true without a CDN — 404s on assets.db:migrate on release — runtime errors.tmp/, log/, node_modules/ from slug.Always cross-reference your platform's current Rails 7+ guide and the spree-starter repo's deployment notes — both move with each Spree release.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin spree-commerce22 skills in this plugin
/spree-admin-customizationCustomize the Spree v5 Admin Dashboard — Tailwind 4 + Hotwire/Turbo/Stimulus stack, the `Spree.admin.navigation` declarative API (v5.2+) for menu items, partial injection slots (`store_nav_partials`, `store_products_nav_partials`, `store_orders_nav_partials`, `settings_nav_partials`), the Admin SDK components + form builder, custom dashboard reports, the Page Builder for storefront editing, and theme management. Use when adding admin pages, injecting UI into existing screens, or building admin extensions./spree-api-v3Build with Spree's v3 APIs (v5.4+) — Store API at `/api/v3/store/*` (publishable key + per-user JWT, customer-facing) and Admin API at `/api/v3/admin/*` (per-user API keys + OAuth2 Doorkeeper, admin/operations). Covers the flat-JSON Stripe-like envelope, `?expand=` / `?include=` parameters, prefixed IDs (`prod_…`, `ord_…`), OpenAPI 3.0 spec, rate limiting, idempotency, and migration from v2 JSON:API. Use when building API clients, SDKs, or extending API endpoints in a Spree v5.4+ deployment./spree-catalogBuild and customize Spree's catalog — Products with Variants and OptionTypes/OptionValues, Taxonomies and Taxons (nested set), Properties, Images via ActiveStorage, multi-currency Prices, the v5.3+ PriceList feature for customer/segment overrides, MeiliSearch faceted search (v5.4+), product archiving/activation, CSV import/export, and SEO. Use when modeling products, customizing the catalog UI, indexing search, or importing inventory.Other plugins' skills for the same job