docker.recipes

Shopware 6 + MySQL + Elasticsearch

advanced

Enterprise e-commerce platform with advanced features.

Overview

Shopware 6 is a German-built open-source e-commerce platform designed for enterprise-grade online stores. Originally launched in 2000 and completely rebuilt from the ground up, Shopware 6 offers advanced features like headless commerce, progressive web app capabilities, and extensive API-first architecture. It competes directly with platforms like Magento and WooCommerce but focuses on providing superior user experience for both merchants and customers with its modern Vue.js-based administration interface and Symfony framework foundation. This stack combines Shopware 6 with MySQL for transactional data storage, Elasticsearch for product search and catalog indexing, Redis for session management and caching, and NGINX as a high-performance web server. MySQL handles all product data, customer information, and order processing with ACID compliance, while Elasticsearch powers the advanced search functionality that modern e-commerce demands. Redis accelerates page load times by caching frequently accessed data and managing user sessions, and NGINX serves static assets efficiently while proxying dynamic requests to Shopware. This configuration is ideal for medium to large online retailers who need scalable search capabilities, fast response times, and enterprise-grade reliability. E-commerce agencies, digital marketing companies, and businesses processing thousands of products with complex filtering requirements will benefit most from this stack. The combination provides the performance needed for high-traffic sales events, complex product catalogs, and multi-language storefronts that require sophisticated search and filtering capabilities.

Key Features

  • Advanced product search with Elasticsearch faceted filtering and auto-suggestions
  • MySQL 8.0 InnoDB storage engine with JSON field support for flexible product attributes
  • Redis-powered shopping cart persistence and user session management
  • Shopware 6 Sales Channel API for headless commerce and mobile app integration
  • NGINX FastCGI caching with 2-hour TTL for improved page load performance
  • Elasticsearch aggregations for real-time inventory filtering and category browsing
  • Shopware Administration interface with Vue.js for modern store management
  • Multi-language and multi-currency support with localized search indexing

Common Use Cases

  • 1Fashion retailers with complex product variations, sizes, and color filtering
  • 2B2B wholesale platforms requiring customer-specific pricing and catalog access
  • 3Multi-brand online stores managing separate inventories and search indexes
  • 4Digital agencies developing custom e-commerce solutions for enterprise clients
  • 5Retailers migrating from Magento or WooCommerce seeking better performance
  • 6Online marketplaces with thousands of products requiring fast search capabilities
  • 7International e-commerce sites needing multi-language product search

Prerequisites

  • Minimum 4GB RAM (2GB for Elasticsearch, 1GB for MySQL, 1GB for Shopware)
  • Docker Engine 20.10+ and Docker Compose 2.0+ installed
  • Port 80 available for NGINX web server access
  • Basic understanding of Shopware 6 administration and store configuration
  • Familiarity with MySQL database management for backup and maintenance
  • Knowledge of Elasticsearch indexing concepts for search optimization

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 shopware:
3 image: shyim/shopware:latest
4 environment:
5 - APP_ENV=prod
6 - APP_SECRET=${APP_SECRET}
7 - DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/shopware
8 - ELASTICSEARCH_HOSTS=elasticsearch:9200
9 - REDIS_HOST=redis
10 - SHOPWARE_HTTP_CACHE_ENABLED=1
11 - SHOPWARE_HTTP_DEFAULT_TTL=7200
12 volumes:
13 - shopware-data:/var/www/html
14 depends_on:
15 - mysql
16 - elasticsearch
17 - redis
18 networks:
19 - shopware-network
20 restart: unless-stopped
21
22 nginx:
23 image: nginx:alpine
24 volumes:
25 - ./nginx.conf:/etc/nginx/nginx.conf:ro
26 - shopware-data:/var/www/html:ro
27 ports:
28 - "80:80"
29 depends_on:
30 - shopware
31 networks:
32 - shopware-network
33 restart: unless-stopped
34
35 mysql:
36 image: mysql:8.0
37 environment:
38 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
39 - MYSQL_DATABASE=shopware
40 - MYSQL_USER=${MYSQL_USER}
41 - MYSQL_PASSWORD=${MYSQL_PASSWORD}
42 volumes:
43 - mysql-data:/var/lib/mysql
44 networks:
45 - shopware-network
46 restart: unless-stopped
47
48 elasticsearch:
49 image: elasticsearch:7.17.10
50 environment:
51 - discovery.type=single-node
52 - ES_JAVA_OPTS=-Xms512m -Xmx512m
53 volumes:
54 - es-data:/usr/share/elasticsearch/data
55 networks:
56 - shopware-network
57 restart: unless-stopped
58
59 redis:
60 image: redis:alpine
61 volumes:
62 - redis-data:/data
63 networks:
64 - shopware-network
65 restart: unless-stopped
66
67volumes:
68 shopware-data:
69 mysql-data:
70 es-data:
71 redis-data:
72
73networks:
74 shopware-network:
75 driver: bridge

.env Template

.env
1# Shopware 6
2APP_SECRET=your-app-secret-change-this
3MYSQL_ROOT_PASSWORD=secure_root_password
4MYSQL_USER=shopware
5MYSQL_PASSWORD=secure_mysql_password

Usage Notes

  1. 1Store at http://localhost
  2. 2Admin at http://localhost/admin
  3. 3Default admin: admin / shopware
  4. 4Elasticsearch for search
  5. 5Redis for caching

Individual Services(5 services)

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

shopware
shopware:
  image: shyim/shopware:latest
  environment:
    - APP_ENV=prod
    - APP_SECRET=${APP_SECRET}
    - DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/shopware
    - ELASTICSEARCH_HOSTS=elasticsearch:9200
    - REDIS_HOST=redis
    - SHOPWARE_HTTP_CACHE_ENABLED=1
    - SHOPWARE_HTTP_DEFAULT_TTL=7200
  volumes:
    - shopware-data:/var/www/html
  depends_on:
    - mysql
    - elasticsearch
    - redis
  networks:
    - shopware-network
  restart: unless-stopped
nginx
nginx:
  image: nginx:alpine
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
    - shopware-data:/var/www/html:ro
  ports:
    - "80:80"
  depends_on:
    - shopware
  networks:
    - shopware-network
  restart: unless-stopped
mysql
mysql:
  image: mysql:8.0
  environment:
    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
    - MYSQL_DATABASE=shopware
    - MYSQL_USER=${MYSQL_USER}
    - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  volumes:
    - mysql-data:/var/lib/mysql
  networks:
    - shopware-network
  restart: unless-stopped
elasticsearch
elasticsearch:
  image: elasticsearch:7.17.10
  environment:
    - discovery.type=single-node
    - ES_JAVA_OPTS=-Xms512m -Xmx512m
  volumes:
    - es-data:/usr/share/elasticsearch/data
  networks:
    - shopware-network
  restart: unless-stopped
redis
redis:
  image: redis:alpine
  volumes:
    - redis-data:/data
  networks:
    - shopware-network
  restart: unless-stopped

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 shopware:
5 image: shyim/shopware:latest
6 environment:
7 - APP_ENV=prod
8 - APP_SECRET=${APP_SECRET}
9 - DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:3306/shopware
10 - ELASTICSEARCH_HOSTS=elasticsearch:9200
11 - REDIS_HOST=redis
12 - SHOPWARE_HTTP_CACHE_ENABLED=1
13 - SHOPWARE_HTTP_DEFAULT_TTL=7200
14 volumes:
15 - shopware-data:/var/www/html
16 depends_on:
17 - mysql
18 - elasticsearch
19 - redis
20 networks:
21 - shopware-network
22 restart: unless-stopped
23
24 nginx:
25 image: nginx:alpine
26 volumes:
27 - ./nginx.conf:/etc/nginx/nginx.conf:ro
28 - shopware-data:/var/www/html:ro
29 ports:
30 - "80:80"
31 depends_on:
32 - shopware
33 networks:
34 - shopware-network
35 restart: unless-stopped
36
37 mysql:
38 image: mysql:8.0
39 environment:
40 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
41 - MYSQL_DATABASE=shopware
42 - MYSQL_USER=${MYSQL_USER}
43 - MYSQL_PASSWORD=${MYSQL_PASSWORD}
44 volumes:
45 - mysql-data:/var/lib/mysql
46 networks:
47 - shopware-network
48 restart: unless-stopped
49
50 elasticsearch:
51 image: elasticsearch:7.17.10
52 environment:
53 - discovery.type=single-node
54 - ES_JAVA_OPTS=-Xms512m -Xmx512m
55 volumes:
56 - es-data:/usr/share/elasticsearch/data
57 networks:
58 - shopware-network
59 restart: unless-stopped
60
61 redis:
62 image: redis:alpine
63 volumes:
64 - redis-data:/data
65 networks:
66 - shopware-network
67 restart: unless-stopped
68
69volumes:
70 shopware-data:
71 mysql-data:
72 es-data:
73 redis-data:
74
75networks:
76 shopware-network:
77 driver: bridge
78EOF
79
80# 2. Create the .env file
81cat > .env << 'EOF'
82# Shopware 6
83APP_SECRET=your-app-secret-change-this
84MYSQL_ROOT_PASSWORD=secure_root_password
85MYSQL_USER=shopware
86MYSQL_PASSWORD=secure_mysql_password
87EOF
88
89# 3. Start the services
90docker compose up -d
91
92# 4. View logs
93docker 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/shopware-complete/run | bash

Troubleshooting

  • Elasticsearch circuit_breaker_exception: Increase ES_JAVA_OPTS memory allocation beyond -Xms512m -Xmx512m
  • Shopware installation wizard shows database connection error: Verify MYSQL_USER and MYSQL_PASSWORD environment variables match
  • Product search returns no results: Check if Elasticsearch indexes are built by running bin/console es:index:populate in Shopware container
  • 502 Bad Gateway from NGINX: Ensure Shopware container is fully started before NGINX attempts proxying
  • Redis connection timeout errors: Verify REDIS_HOST environment variable points to correct service name 'redis'
  • MySQL access denied errors: Wait for MySQL initialization to complete before starting dependent services

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