docker.recipes

Saleor

advanced

GraphQL-first e-commerce platform.

Overview

Saleor is a modern, headless e-commerce platform built with Python and Django that prioritizes GraphQL APIs over traditional REST endpoints. Created by Mirumee Software in 2012, Saleor has evolved into a powerful enterprise-grade solution that separates the backend commerce engine from frontend presentation layers, enabling businesses to build custom shopping experiences across web, mobile, and emerging channels. The platform emphasizes developer experience with comprehensive GraphQL APIs, extensive webhook systems, and a plugin architecture that supports complex business requirements. This stack combines Saleor's commerce engine with PostgreSQL for robust transactional data management and Redis for high-performance caching and session storage. PostgreSQL provides the ACID compliance essential for financial transactions, inventory management, and customer data integrity, while Redis accelerates API responses through intelligent caching of product catalogs, user sessions, and frequently accessed data. The combination creates a scalable foundation capable of handling everything from startup marketplaces to enterprise multi-channel operations. Organizations choosing this stack gain access to advanced commerce features like multi-tenant architecture, international selling capabilities with localized currencies and tax calculations, sophisticated inventory management across multiple warehouses, and extensible checkout flows. The GraphQL-first approach enables frontend teams to work independently while maintaining type safety and efficient data fetching, making this particularly valuable for businesses requiring custom user experiences or integration with existing systems.

Key Features

  • GraphQL Playground interface at /graphql/ for API exploration and testing with full schema introspection
  • Multi-channel commerce supporting separate storefronts, pricing, and inventory per sales channel
  • Advanced inventory management with multi-warehouse support and stock allocation strategies
  • International commerce features including multi-currency pricing, tax calculation, and localized shipping
  • Webhook system for real-time event notifications to external systems and custom integrations
  • Plugin architecture supporting custom business logic, payment gateways, and third-party integrations
  • PostgreSQL JSONB fields for flexible product attributes and metadata without schema migrations
  • Redis-powered caching for product catalogs, user sessions, and API response optimization

Common Use Cases

  • 1Headless e-commerce for brands wanting custom frontend experiences across web, mobile, and IoT devices
  • 2B2B marketplaces requiring complex pricing structures, customer-specific catalogs, and approval workflows
  • 3Multi-brand retailers managing separate storefronts with shared inventory and unified administration
  • 4International commerce operations needing localized pricing, tax calculation, and regional shipping options
  • 5Subscription commerce businesses requiring recurring billing, customer portals, and flexible product variants
  • 6Enterprise migrations from legacy platforms needing API-first architecture for system integrations
  • 7Marketplace platforms where multiple vendors sell through a unified commerce engine

Prerequisites

  • Minimum 2GB RAM recommended for Saleor application server with moderate product catalogs
  • Additional 1GB+ RAM for PostgreSQL to handle transactional workloads and complex queries efficiently
  • Port 8000 available for Saleor GraphQL API and administrative interface access
  • Understanding of GraphQL query syntax for API integration and frontend development
  • Familiarity with environment variable management for database credentials and application secrets
  • Basic knowledge of PostgreSQL administration for backup strategies and performance tuning

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 saleor:
3 image: ghcr.io/saleor/saleor:latest
4 container_name: saleor
5 restart: unless-stopped
6 environment:
7 DATABASE_URL: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
8 REDIS_URL: redis://redis:6379
9 SECRET_KEY: ${SECRET_KEY}
10 ports:
11 - "8000:8000"
12 depends_on:
13 - postgres
14 - redis
15 networks:
16 - saleor
17
18 postgres:
19 image: postgres:16-alpine
20 container_name: saleor-postgres
21 environment:
22 POSTGRES_DB: ${DB_NAME}
23 POSTGRES_USER: ${DB_USER}
24 POSTGRES_PASSWORD: ${DB_PASSWORD}
25 volumes:
26 - postgres_data:/var/lib/postgresql/data
27 networks:
28 - saleor
29
30 redis:
31 image: redis:alpine
32 container_name: saleor-redis
33 networks:
34 - saleor
35
36volumes:
37 postgres_data:
38
39networks:
40 saleor:
41 driver: bridge

.env Template

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

Usage Notes

  1. 1Docs: https://docs.saleor.io/
  2. 2GraphQL API at http://localhost:8000/graphql/ with Playground
  3. 3Dashboard: deploy saleor-dashboard separately at port 9000
  4. 4Storefront: use saleor-storefront or react-storefront templates
  5. 5Multi-channel, multi-warehouse, multi-currency support
  6. 6Webhooks and apps ecosystem for extensibility

Individual Services(3 services)

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

saleor
saleor:
  image: ghcr.io/saleor/saleor:latest
  container_name: saleor
  restart: unless-stopped
  environment:
    DATABASE_URL: postgres://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
    REDIS_URL: redis://redis:6379
    SECRET_KEY: ${SECRET_KEY}
  ports:
    - "8000:8000"
  depends_on:
    - postgres
    - redis
  networks:
    - saleor
postgres
postgres:
  image: postgres:16-alpine
  container_name: saleor-postgres
  environment:
    POSTGRES_DB: ${DB_NAME}
    POSTGRES_USER: ${DB_USER}
    POSTGRES_PASSWORD: ${DB_PASSWORD}
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - saleor
redis
redis:
  image: redis:alpine
  container_name: saleor-redis
  networks:
    - saleor

Quick Start

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

Troubleshooting

  • Saleor container exits with database connection errors: Verify DATABASE_URL format and ensure PostgreSQL container is healthy before Saleor starts
  • GraphQL queries timeout or return slowly: Check Redis container status and verify REDIS_URL connectivity for caching functionality
  • Product images not displaying properly: Configure media storage settings and ensure proper volume mounts or cloud storage integration
  • Migration errors during startup: Clear PostgreSQL data volume and restart stack to rebuild database schema from scratch
  • SECRET_KEY warnings in logs: Generate cryptographically secure secret key and set in environment variables for session security
  • Memory exhaustion with large catalogs: Increase container memory limits and optimize PostgreSQL shared_buffers configuration

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