docker.recipes

Vendure

intermediate

Headless e-commerce framework with GraphQL.

Overview

Vendure is a modern, open-source headless e-commerce framework built with TypeScript and Node.js that provides GraphQL-first APIs for building custom commerce experiences. Launched in 2019, Vendure was designed to address the limitations of traditional monolithic e-commerce platforms by offering a developer-friendly, extensible architecture that separates the commerce engine from the presentation layer. This approach enables businesses to create unique shopping experiences across web, mobile, and emerging channels while maintaining full control over their commerce logic. This Docker stack combines Vendure's powerful e-commerce engine with PostgreSQL's robust relational database capabilities to create a production-ready headless commerce platform. PostgreSQL's ACID compliance and advanced querying features make it ideal for handling complex e-commerce operations like inventory management, order processing, and customer data relationships. The combination leverages PostgreSQL's JSON support for flexible product attributes while maintaining referential integrity for critical business data like transactions and customer records. This configuration is perfect for development teams building custom e-commerce solutions, agencies creating commerce platforms for clients, or businesses transitioning from legacy e-commerce systems to modern headless architectures. The stack provides both a complete admin interface for content management and dual GraphQL APIs for frontend integration, making it suitable for everything from rapid prototyping to enterprise-scale deployments.

Key Features

  • Dual GraphQL APIs with separate shop and admin endpoints for secure role-based access
  • Built-in admin UI with comprehensive product, order, and customer management capabilities
  • Extensible plugin architecture supporting custom payment processors, shipping calculators, and business logic
  • Multi-channel support for managing different storefronts, currencies, and tax zones
  • Advanced product modeling with variants, facets, and collections for complex catalog structures
  • Real-time inventory tracking with stock allocation and backorder management
  • Flexible promotion engine supporting percentage, fixed amount, and tiered discount strategies
  • PostgreSQL integration with optimized queries for e-commerce operations and full-text product search

Common Use Cases

  • 1Building custom storefronts with React, Vue, or Angular while leveraging a robust commerce backend
  • 2Creating multi-brand e-commerce platforms where each brand needs distinct catalogs and pricing
  • 3Developing B2B commerce solutions with custom pricing tiers and approval workflows
  • 4Migrating from Shopify Plus or Magento to a more flexible, developer-controlled platform
  • 5Building marketplace platforms that require complex vendor management and commission structures
  • 6Creating omnichannel retail experiences that sync inventory across web, mobile, and POS systems
  • 7Developing subscription commerce platforms with recurring billing and customer lifecycle management

Prerequisites

  • Minimum 2GB RAM recommended for combined Vendure and PostgreSQL operations
  • Port 3000 available for Vendure GraphQL APIs and admin interface access
  • Basic understanding of GraphQL queries and mutations for API integration
  • Node.js and TypeScript knowledge for customizing Vendure plugins and configuration
  • Familiarity with PostgreSQL for database optimization and backup strategies
  • Understanding of headless commerce concepts and API-driven frontend development

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 vendure:
3 image: vendure/vendure:latest
4 container_name: vendure
5 restart: unless-stopped
6 environment:
7 DB_HOST: postgres
8 DB_PORT: 5432
9 DB_NAME: ${DB_NAME}
10 DB_USERNAME: ${DB_USER}
11 DB_PASSWORD: ${DB_PASSWORD}
12 ports:
13 - "3000:3000"
14 depends_on:
15 - postgres
16 networks:
17 - vendure
18
19 postgres:
20 image: postgres:16-alpine
21 container_name: vendure-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 - vendure
30
31volumes:
32 postgres_data:
33
34networks:
35 vendure:
36 driver: bridge

.env Template

.env
1DB_NAME=vendure
2DB_USER=vendure
3DB_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://docs.vendure.io/
  2. 2Admin UI at http://localhost:3000/admin (superadmin/superadmin)
  3. 3Shop GraphQL API at http://localhost:3000/shop-api
  4. 4Admin GraphQL API at http://localhost:3000/admin-api
  5. 5TypeScript + Node.js, highly extensible plugin architecture
  6. 6Built for headless commerce with any frontend framework

Individual Services(2 services)

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

vendure
vendure:
  image: vendure/vendure:latest
  container_name: vendure
  restart: unless-stopped
  environment:
    DB_HOST: postgres
    DB_PORT: 5432
    DB_NAME: ${DB_NAME}
    DB_USERNAME: ${DB_USER}
    DB_PASSWORD: ${DB_PASSWORD}
  ports:
    - "3000:3000"
  depends_on:
    - postgres
  networks:
    - vendure
postgres
postgres:
  image: postgres:16-alpine
  container_name: vendure-postgres
  environment:
    POSTGRES_DB: ${DB_NAME}
    POSTGRES_USER: ${DB_USER}
    POSTGRES_PASSWORD: ${DB_PASSWORD}
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - vendure

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 vendure:
5 image: vendure/vendure:latest
6 container_name: vendure
7 restart: unless-stopped
8 environment:
9 DB_HOST: postgres
10 DB_PORT: 5432
11 DB_NAME: ${DB_NAME}
12 DB_USERNAME: ${DB_USER}
13 DB_PASSWORD: ${DB_PASSWORD}
14 ports:
15 - "3000:3000"
16 depends_on:
17 - postgres
18 networks:
19 - vendure
20
21 postgres:
22 image: postgres:16-alpine
23 container_name: vendure-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 - vendure
32
33volumes:
34 postgres_data:
35
36networks:
37 vendure:
38 driver: bridge
39EOF
40
41# 2. Create the .env file
42cat > .env << 'EOF'
43DB_NAME=vendure
44DB_USER=vendure
45DB_PASSWORD=changeme
46EOF
47
48# 3. Start the services
49docker compose up -d
50
51# 4. View logs
52docker 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/vendure/run | bash

Troubleshooting

  • Database connection failed: Verify PostgreSQL container is running and DB_HOST matches the postgres service name in the network
  • Admin UI shows 'Cannot connect to server': Check that Vendure container started successfully after PostgreSQL and database migrations completed
  • GraphQL queries return authentication errors: Ensure you're using the correct API endpoint (shop-api vs admin-api) and proper authorization headers
  • Product images not displaying: Configure asset storage settings in Vendure config and ensure proper file upload permissions
  • Performance issues with large catalogs: Optimize PostgreSQL memory settings and consider adding database indexes for custom product queries
  • Plugin installation failures: Verify TypeScript compilation succeeds and all plugin dependencies are included in the container build

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