docker.recipes

Reaction Commerce

advanced

Real-time, modern e-commerce platform.

Overview

Reaction Commerce is an open-source, API-first e-commerce platform built on Node.js that pioneered the modern headless commerce approach. Originally developed as a real-time commerce platform using Meteor.js, Reaction provides a GraphQL-first architecture with modular microservices designed for scalability and customization. The platform emphasizes real-time inventory updates, flexible product catalogs, and extensible plugin architecture for payments, shipping, and tax calculations. This Docker stack combines Reaction Commerce with MongoDB 6 to create a complete e-commerce backend with persistent document storage and real-time capabilities. MongoDB serves as the primary database for storing product catalogs, order data, customer information, and inventory levels, while its change streams enable Reaction's real-time features like live inventory updates and order tracking. The combination provides a modern alternative to traditional e-commerce platforms like Magento or Shopify, offering complete API control and customization freedom. This stack is ideal for developers building custom storefronts, businesses requiring complex product configurations, and organizations needing real-time inventory management across multiple sales channels. The GraphQL API enables headless implementations with React, Vue, or mobile applications while maintaining real-time synchronization through subscriptions.

Key Features

  • GraphQL API with real-time subscriptions for live inventory and order updates
  • Plugin-based architecture for payments, shipping, taxes, and custom business logic
  • Multi-tenant marketplace support with vendor management and commission tracking
  • Advanced product catalog with variants, options, and complex pricing rules
  • Real-time inventory management with automatic stock level synchronization
  • MongoDB change streams integration for instant data propagation across services
  • Operator dashboard for store management and administrative functions
  • Headless commerce API supporting multiple frontend frameworks and mobile apps

Common Use Cases

  • 1Building custom e-commerce storefronts with React, Vue, or Angular frontends
  • 2Creating multi-vendor marketplaces with independent seller management
  • 3Developing mobile-first commerce applications with real-time inventory sync
  • 4Implementing B2B e-commerce platforms with complex pricing and approval workflows
  • 5Setting up omnichannel retail systems connecting online and physical stores
  • 6Creating subscription commerce platforms with recurring billing and inventory automation
  • 7Building API-driven commerce solutions for IoT devices and voice assistants

Prerequisites

  • Docker and Docker Compose installed with at least 4GB RAM available for containers
  • Port 3000 available for Reaction Commerce web interface and GraphQL API
  • Basic understanding of GraphQL queries and mutations for API interaction
  • Node.js and JavaScript knowledge for customizing plugins and business logic
  • MongoDB query familiarity for direct database operations and troubleshooting
  • At least 10GB free disk space for MongoDB data storage and container images

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 reaction:
3 image: reactioncommerce/reaction:latest
4 container_name: reaction
5 restart: unless-stopped
6 environment:
7 MONGO_URL: mongodb://mongodb:27017/${DB_NAME}
8 ROOT_URL: http://localhost:3000
9 ports:
10 - "3000:3000"
11 depends_on:
12 - mongodb
13 networks:
14 - reaction
15
16 mongodb:
17 image: mongo:6
18 container_name: reaction-mongodb
19 volumes:
20 - mongodb_data:/data/db
21 networks:
22 - reaction
23
24volumes:
25 mongodb_data:
26
27networks:
28 reaction:
29 driver: bridge

.env Template

.env
1DB_NAME=reaction

Usage Notes

  1. 1Docs: https://docs.reactioncommerce.com/
  2. 2Access at http://localhost:3000 - real-time updates via GraphQL subscriptions
  3. 3GraphQL-first architecture with Meteor.js backend
  4. 4Admin: http://localhost:3000/operator (create admin on first run)
  5. 5Plugin-based: payments, shipping, taxes are all plugins
  6. 6Modern microservices architecture with Node.js

Individual Services(2 services)

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

reaction
reaction:
  image: reactioncommerce/reaction:latest
  container_name: reaction
  restart: unless-stopped
  environment:
    MONGO_URL: mongodb://mongodb:27017/${DB_NAME}
    ROOT_URL: http://localhost:3000
  ports:
    - "3000:3000"
  depends_on:
    - mongodb
  networks:
    - reaction
mongodb
mongodb:
  image: mongo:6
  container_name: reaction-mongodb
  volumes:
    - mongodb_data:/data/db
  networks:
    - reaction

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 reaction:
5 image: reactioncommerce/reaction:latest
6 container_name: reaction
7 restart: unless-stopped
8 environment:
9 MONGO_URL: mongodb://mongodb:27017/${DB_NAME}
10 ROOT_URL: http://localhost:3000
11 ports:
12 - "3000:3000"
13 depends_on:
14 - mongodb
15 networks:
16 - reaction
17
18 mongodb:
19 image: mongo:6
20 container_name: reaction-mongodb
21 volumes:
22 - mongodb_data:/data/db
23 networks:
24 - reaction
25
26volumes:
27 mongodb_data:
28
29networks:
30 reaction:
31 driver: bridge
32EOF
33
34# 2. Create the .env file
35cat > .env << 'EOF'
36DB_NAME=reaction
37EOF
38
39# 3. Start the services
40docker compose up -d
41
42# 4. View logs
43docker 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/reaction-commerce/run | bash

Troubleshooting

  • Connection to MongoDB failed: Verify mongodb container is running and check network connectivity with docker network ls
  • Reaction fails to start with MONGO_URL error: Ensure DB_NAME environment variable is set and MongoDB is accepting connections on port 27017
  • GraphQL playground returns 404 error: Wait for Reaction to fully initialize (can take 2-3 minutes on first startup) and verify ROOT_URL matches your access URL
  • Admin panel shows blank page: Clear browser cache and ensure operator route is accessible at /operator, create first admin user if none exists
  • Real-time subscriptions not working: Check WebSocket connections are not blocked by proxy or firewall, and MongoDB change streams are enabled
  • Plugin installation fails: Verify Node.js dependencies and ensure Reaction container has write permissions to plugin directories

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