docker.recipes

Solidus

intermediate

Fork of Spree with enhanced features.

Overview

Solidus is an open-source, Ruby on Rails-based ecommerce platform that emerged as a community-driven fork of Spree Commerce in 2015. Built with extensibility and stability as core principles, Solidus provides a flexible foundation for building custom online stores while maintaining backward compatibility and offering enhanced features over its predecessor. The platform emphasizes clean architecture, comprehensive APIs, and a modular extension system that allows developers to customize functionality without modifying core code. This Docker stack combines Solidus with PostgreSQL to create a robust ecommerce environment that leverages PostgreSQL's advanced relational capabilities for handling complex product catalogs, inventory management, order processing, and customer data. PostgreSQL's ACID compliance ensures data integrity for critical ecommerce operations like payment processing and inventory updates, while its JSON support enables flexible product attribute storage and search functionality that modern online stores require. This configuration is ideal for Ruby developers building sophisticated ecommerce platforms, agencies creating custom online stores for clients, and businesses migrating from Spree who need enhanced customization capabilities. The combination provides the stability required for production ecommerce environments while maintaining the flexibility to implement complex business logic, multi-tenant architectures, and custom integrations with payment gateways, shipping providers, and third-party services.

Key Features

  • Multi-store support with shared product catalogs and independent configurations per store
  • Comprehensive order state machine with customizable fulfillment and return workflows
  • Flexible product variant system supporting unlimited option types and complex pricing rules
  • Built-in promotion engine with coupon codes, bulk discounts, and rule-based pricing
  • Extensible payment gateway architecture with Stripe, Braintree, and PayPal integrations
  • Advanced inventory tracking with stock locations, backorders, and automated reorder points
  • RESTful API with GraphQL support for headless commerce implementations
  • PostgreSQL's full-text search capabilities for product discovery and filtering

Common Use Cases

  • 1Fashion retailers requiring complex product variants with size, color, and style combinations
  • 2B2B marketplaces needing role-based pricing, bulk ordering, and customer-specific catalogs
  • 3Multi-brand retailers operating separate storefronts with shared inventory management
  • 4Subscription commerce businesses requiring recurring billing and subscription management
  • 5International ecommerce sites needing multi-currency support and localized tax calculations
  • 6Digital product stores selling downloadable content with license management
  • 7Marketplace platforms connecting multiple vendors with commission tracking and payout systems

Prerequisites

  • Docker and Docker Compose installed with at least 2GB available RAM for PostgreSQL operations
  • Ruby on Rails knowledge for customizing Solidus functionality and creating extensions
  • Understanding of PostgreSQL administration for database optimization and maintenance
  • Port 3000 available for Solidus storefront and admin interface access
  • SSL certificate and reverse proxy configuration for production deployments
  • Payment gateway accounts (Stripe, PayPal, etc.) for processing customer transactions

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 solidus:
3 image: solidusio/solidus:latest
4 container_name: solidus
5 restart: unless-stopped
6 environment:
7 DATABASE_URL: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
8 SECRET_KEY_BASE: ${SECRET_KEY}
9 RAILS_ENV: production
10 volumes:
11 - solidus_data:/app/public
12 ports:
13 - "3000:3000"
14 depends_on:
15 - postgres
16 networks:
17 - solidus
18
19 postgres:
20 image: postgres:16-alpine
21 container_name: solidus-postgres
22 environment:
23 POSTGRES_DB: ${DB_NAME}
24 POSTGRES_USER: ${DB_USER}
25 POSTGRES_PASSWORD: ${DB_PASSWORD}
26 volumes:
27 - postgres_data:/var/lib/postgresql/data
28 networks:
29 - solidus
30
31volumes:
32 solidus_data:
33 postgres_data:
34
35networks:
36 solidus:
37 driver: bridge

.env Template

.env
1DB_NAME=solidus
2DB_USER=solidus
3DB_PASSWORD=changeme
4SECRET_KEY=your-secret-key

Usage Notes

  1. 1Docs: https://solidus.io/developers/
  2. 2Access storefront at http://localhost:3000, admin at /admin
  3. 3Fork of Spree with focus on stability and customization
  4. 4Ruby on Rails based - extensible via Solidus extensions
  5. 5Default admin: admin@example.com / test123
  6. 6Payment gateway integrations: Stripe, Braintree, PayPal, etc.

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

solidus
solidus:
  image: solidusio/solidus:latest
  container_name: solidus
  restart: unless-stopped
  environment:
    DATABASE_URL: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
    SECRET_KEY_BASE: ${SECRET_KEY}
    RAILS_ENV: production
  volumes:
    - solidus_data:/app/public
  ports:
    - "3000:3000"
  depends_on:
    - postgres
  networks:
    - solidus
postgres
postgres:
  image: postgres:16-alpine
  container_name: solidus-postgres
  environment:
    POSTGRES_DB: ${DB_NAME}
    POSTGRES_USER: ${DB_USER}
    POSTGRES_PASSWORD: ${DB_PASSWORD}
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - solidus

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 solidus:
5 image: solidusio/solidus:latest
6 container_name: solidus
7 restart: unless-stopped
8 environment:
9 DATABASE_URL: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
10 SECRET_KEY_BASE: ${SECRET_KEY}
11 RAILS_ENV: production
12 volumes:
13 - solidus_data:/app/public
14 ports:
15 - "3000:3000"
16 depends_on:
17 - postgres
18 networks:
19 - solidus
20
21 postgres:
22 image: postgres:16-alpine
23 container_name: solidus-postgres
24 environment:
25 POSTGRES_DB: ${DB_NAME}
26 POSTGRES_USER: ${DB_USER}
27 POSTGRES_PASSWORD: ${DB_PASSWORD}
28 volumes:
29 - postgres_data:/var/lib/postgresql/data
30 networks:
31 - solidus
32
33volumes:
34 solidus_data:
35 postgres_data:
36
37networks:
38 solidus:
39 driver: bridge
40EOF
41
42# 2. Create the .env file
43cat > .env << 'EOF'
44DB_NAME=solidus
45DB_USER=solidus
46DB_PASSWORD=changeme
47SECRET_KEY=your-secret-key
48EOF
49
50# 3. Start the services
51docker compose up -d
52
53# 4. View logs
54docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/solidus/run | bash

Troubleshooting

  • Solidus container fails with 'database does not exist': Ensure PostgreSQL container starts first and DATABASE_URL environment variable matches database credentials
  • Admin login fails with invalid credentials: Use default admin@example.com/test123 or create new admin user via Rails console in container
  • Asset precompilation errors in production: Verify SECRET_KEY_BASE is set and run 'rails assets:precompile' in Solidus container
  • Payment gateway integration not working: Check that payment method extensions are installed and gateway credentials are configured in admin panel
  • PostgreSQL connection errors after restart: Verify postgres_data volume persists and database user has correct permissions for the specified database
  • Solidus extensions not loading: Ensure extensions are added to Gemfile and bundle install is run when building custom Solidus image

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space