WooCommerce Complete E-commerce
WordPress WooCommerce with payment gateways, caching, and search.
Overview
WordPress is the world's most popular content management system, powering over 40% of all websites. Originally launched in 2003 as a blogging platform, it has evolved into a comprehensive CMS that supports everything from simple blogs to complex enterprise websites. When combined with WooCommerce, WordPress transforms into a powerful e-commerce platform capable of handling everything from small online stores to large-scale retail operations with millions of products.
This stack combines WordPress and WooCommerce with MySQL for robust data storage, Redis for high-performance caching and session management, Elasticsearch for advanced product search capabilities, and NGINX as a high-performance web server and reverse proxy. MySQL's InnoDB storage engine provides ACID compliance for transactional integrity crucial for e-commerce operations, while Redis delivers sub-millisecond response times for cart data and user sessions. Elasticsearch enables sophisticated product search with relevance scoring and faceted navigation, and NGINX's event-driven architecture handles high-traffic loads efficiently.
This configuration is ideal for businesses launching serious e-commerce operations, developers building custom online stores, and agencies managing multiple client shops. The combination provides enterprise-grade performance and scalability while maintaining WordPress's ease of use. With WooCommerce's extensive payment gateway integrations, Redis caching for improved page load times, and Elasticsearch's advanced search capabilities, this stack can handle everything from boutique stores to high-volume marketplaces with complex product catalogs.
Key Features
- WooCommerce integration with 100+ payment gateways including PayPal, Stripe, and Square
- Redis Object Cache for sub-millisecond session storage and database query caching
- Elasticsearch full-text search with relevance scoring and product filtering
- MySQL InnoDB storage engine with ACID compliance for secure transaction processing
- NGINX reverse proxy with HTTP/2 support and SSL/TLS termination
- WordPress plugin ecosystem with 60,000+ plugins for unlimited functionality
- ElasticPress integration for advanced product search and analytics
- Redis-based cart persistence and user session management
Common Use Cases
- 1High-traffic online stores requiring fast product search and checkout processes
- 2Multi-vendor marketplaces with complex product catalogs and search requirements
- 3B2B e-commerce platforms with custom pricing and bulk ordering capabilities
- 4Digital product stores selling software, courses, or subscription services
- 5Fashion or electronics retailers needing advanced filtering and search functionality
- 6International e-commerce sites requiring multiple payment methods and currencies
- 7Dropshipping businesses managing large product inventories from multiple suppliers
Prerequisites
- Docker Engine 20.10+ and Docker Compose 2.0+ installed
- Minimum 4GB RAM (2GB for Elasticsearch, 1GB for WordPress/MySQL, 512MB for Redis)
- At least 10GB available disk space for WordPress files and database storage
- Ports 80, 443, and 8081 available on the host system
- Basic understanding of WordPress administration and WooCommerce configuration
- SSL certificates for production deployment (self-signed acceptable for 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 mysql: 3 image: mysql:8.04 environment: 5 - MYSQL_DATABASE=wordpress6 - MYSQL_USER=wordpress7 - MYSQL_PASSWORD=${MYSQL_PASSWORD}8 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}9 volumes: 10 - mysql_data:/var/lib/mysql11 networks: 12 - woo_net1314 redis: 15 image: redis:7-alpine16 volumes: 17 - redis_data:/data18 networks: 19 - woo_net2021 elasticsearch: 22 image: docker.elastic.co/elasticsearch/elasticsearch:8.11.023 environment: 24 - discovery.type=single-node25 - xpack.security.enabled=false26 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"27 volumes: 28 - es_data:/usr/share/elasticsearch/data29 networks: 30 - woo_net3132 wordpress: 33 image: wordpress:latest34 environment: 35 - WORDPRESS_DB_HOST=mysql36 - WORDPRESS_DB_NAME=wordpress37 - WORDPRESS_DB_USER=wordpress38 - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}39 - WORDPRESS_CONFIG_EXTRA=40 define('WP_REDIS_HOST', 'redis');41 define('WP_REDIS_PORT', 6379);42 volumes: 43 - wordpress_data:/var/www/html44 depends_on: 45 - mysql46 - redis47 networks: 48 - woo_net4950 nginx: 51 image: nginx:alpine52 ports: 53 - "80:80"54 - "443:443"55 volumes: 56 - ./nginx.conf:/etc/nginx/nginx.conf:ro57 - wordpress_data:/var/www/html:ro58 - ./ssl:/etc/nginx/ssl:ro59 depends_on: 60 - wordpress61 networks: 62 - woo_net6364 phpmyadmin: 65 image: phpmyadmin:latest66 ports: 67 - "8081:80"68 environment: 69 - PMA_HOST=mysql70 - PMA_USER=wordpress71 - PMA_PASSWORD=${MYSQL_PASSWORD}72 depends_on: 73 - mysql74 networks: 75 - woo_net7677volumes: 78 mysql_data: 79 redis_data: 80 es_data: 81 wordpress_data: 8283networks: 84 woo_net: .env Template
.env
1# WooCommerce2MYSQL_PASSWORD=secure_mysql_password3MYSQL_ROOT_PASSWORD=secure_root_password45# WordPress at http://localhost6# phpMyAdmin at http://localhost:8081Usage Notes
- 1WordPress at http://localhost
- 2phpMyAdmin at http://localhost:8081
- 3Install WooCommerce via WordPress admin
- 4Redis Object Cache plugin recommended
- 5ElasticPress for Elasticsearch integration
Individual Services(6 services)
Copy individual services to mix and match with your existing compose files.
mysql
mysql:
image: mysql:8.0
environment:
- MYSQL_DATABASE=wordpress
- MYSQL_USER=wordpress
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- woo_net
redis
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
networks:
- woo_net
elasticsearch
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms512m -Xmx512m
volumes:
- es_data:/usr/share/elasticsearch/data
networks:
- woo_net
wordpress
wordpress:
image: wordpress:latest
environment:
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_NAME=wordpress
- WORDPRESS_DB_USER=wordpress
- WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}
- WORDPRESS_CONFIG_EXTRA= define('WP_REDIS_HOST', 'redis'); define('WP_REDIS_PORT', 6379);
volumes:
- wordpress_data:/var/www/html
depends_on:
- mysql
- redis
networks:
- woo_net
nginx
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- wordpress_data:/var/www/html:ro
- ./ssl:/etc/nginx/ssl:ro
depends_on:
- wordpress
networks:
- woo_net
phpmyadmin
phpmyadmin:
image: phpmyadmin:latest
ports:
- "8081:80"
environment:
- PMA_HOST=mysql
- PMA_USER=wordpress
- PMA_PASSWORD=${MYSQL_PASSWORD}
depends_on:
- mysql
networks:
- woo_net
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 mysql:5 image: mysql:8.06 environment:7 - MYSQL_DATABASE=wordpress8 - MYSQL_USER=wordpress9 - MYSQL_PASSWORD=${MYSQL_PASSWORD}10 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}11 volumes:12 - mysql_data:/var/lib/mysql13 networks:14 - woo_net1516 redis:17 image: redis:7-alpine18 volumes:19 - redis_data:/data20 networks:21 - woo_net2223 elasticsearch:24 image: docker.elastic.co/elasticsearch/elasticsearch:8.11.025 environment:26 - discovery.type=single-node27 - xpack.security.enabled=false28 - "ES_JAVA_OPTS=-Xms512m -Xmx512m"29 volumes:30 - es_data:/usr/share/elasticsearch/data31 networks:32 - woo_net3334 wordpress:35 image: wordpress:latest36 environment:37 - WORDPRESS_DB_HOST=mysql38 - WORDPRESS_DB_NAME=wordpress39 - WORDPRESS_DB_USER=wordpress40 - WORDPRESS_DB_PASSWORD=${MYSQL_PASSWORD}41 - WORDPRESS_CONFIG_EXTRA=42 define('WP_REDIS_HOST', 'redis');43 define('WP_REDIS_PORT', 6379);44 volumes:45 - wordpress_data:/var/www/html46 depends_on:47 - mysql48 - redis49 networks:50 - woo_net5152 nginx:53 image: nginx:alpine54 ports:55 - "80:80"56 - "443:443"57 volumes:58 - ./nginx.conf:/etc/nginx/nginx.conf:ro59 - wordpress_data:/var/www/html:ro60 - ./ssl:/etc/nginx/ssl:ro61 depends_on:62 - wordpress63 networks:64 - woo_net6566 phpmyadmin:67 image: phpmyadmin:latest68 ports:69 - "8081:80"70 environment:71 - PMA_HOST=mysql72 - PMA_USER=wordpress73 - PMA_PASSWORD=${MYSQL_PASSWORD}74 depends_on:75 - mysql76 networks:77 - woo_net7879volumes:80 mysql_data:81 redis_data:82 es_data:83 wordpress_data:8485networks:86 woo_net:87EOF8889# 2. Create the .env file90cat > .env << 'EOF'91# WooCommerce92MYSQL_PASSWORD=secure_mysql_password93MYSQL_ROOT_PASSWORD=secure_root_password9495# WordPress at http://localhost96# phpMyAdmin at http://localhost:808197EOF9899# 3. Start the services100docker compose up -d101102# 4. View logs103docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/woocommerce-complete/run | bashTroubleshooting
- Elasticsearch container exits with 'max virtual memory areas vm.max_map_count too low': Run 'sudo sysctl -w vm.max_map_count=262144' on the host system
- WordPress shows 'Error establishing a database connection': Verify MYSQL_PASSWORD environment variable matches in both wordpress and mysql services
- Redis Object Cache plugin shows 'Connection refused': Ensure Redis container is running and WordPress container can reach redis:6379
- WooCommerce product search returns no results: Install and configure ElasticPress plugin to connect WordPress to the elasticsearch container
- NGINX returns 502 Bad Gateway: Check that wordpress container is healthy and nginx.conf has correct upstream configuration pointing to wordpress:80
- phpMyAdmin access denied: Verify PMA_PASSWORD matches MYSQL_PASSWORD and mysql container is fully initialized before accessing
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
Components
wordpressmysqlrediselasticsearchnginx
Tags
#woocommerce#wordpress#ecommerce#payments#php
Category
E-Commerce & BusinessAd Space
Shortcuts: C CopyF FavoriteD Download