docker.recipes

PrestaShop E-commerce

intermediate

PrestaShop with MySQL and Elasticsearch.

Overview

PrestaShop is a powerful open-source e-commerce platform written in PHP that enables businesses to create and manage online stores with professional-grade features. Originally launched in 2007, PrestaShop has grown to power over 300,000 online shops worldwide, offering comprehensive product catalog management, order processing, payment integration, and customer relationship tools. The platform provides extensive customization capabilities through themes and modules, supporting everything from small boutique stores to large enterprise e-commerce operations with multi-store and multi-language functionality. This stack combines PrestaShop with MySQL 8.0 for robust transactional data storage and Elasticsearch 7.17 for advanced search capabilities. MySQL handles all e-commerce data including products, customers, orders, and inventory with ACID compliance ensuring data integrity during high-volume transactions. Elasticsearch enhances the shopping experience by providing lightning-fast product search with relevance scoring, faceted navigation, and auto-complete suggestions that significantly improve conversion rates compared to basic SQL-based search. This configuration is ideal for medium to large e-commerce businesses that need professional search functionality and can handle the additional complexity of managing Elasticsearch alongside their traditional database. Store owners who prioritize customer experience through fast, accurate product discovery will benefit most from this setup, as the Elasticsearch integration can dramatically improve search performance and provide analytics insights into customer search behavior.

Key Features

  • Auto-installation PrestaShop setup with configurable admin panel access through custom folder naming
  • MySQL 8.0 with InnoDB storage engine providing ACID compliance for order processing and inventory management
  • Elasticsearch full-text search with relevance scoring and faceted navigation for product catalogs
  • PrestaShop's built-in multi-store management allowing multiple shops from single installation
  • Advanced product catalog features including variants, combinations, and stock management
  • Integrated payment gateway support for major providers like PayPal, Stripe, and regional processors
  • MySQL Group Replication compatibility for high-availability e-commerce deployments
  • Elasticsearch aggregations for sales analytics and customer behavior insights

Common Use Cases

  • 1Fashion retailers needing advanced search with color, size, and brand filtering capabilities
  • 2Electronics stores requiring detailed product specifications search and comparison features
  • 3Multi-brand marketplaces managing thousands of products across different categories
  • 4B2B wholesale platforms with complex pricing tiers and customer-specific catalogs
  • 5International e-commerce sites leveraging multi-language and multi-currency support
  • 6Growing online stores migrating from basic platforms to enterprise-grade search functionality
  • 7Dropshipping businesses managing large product catalogs from multiple suppliers

Prerequisites

  • Minimum 4GB RAM (2GB for Elasticsearch, 1GB for MySQL, 1GB for PrestaShop and system overhead)
  • Docker and Docker Compose installed with at least 10GB available disk space
  • Port 8080 available for PrestaShop web interface access
  • Basic understanding of e-commerce concepts and PrestaShop administration
  • Environment variables configured: DB_USER, DB_PASSWORD, DB_ROOT_PASSWORD, ADMIN_EMAIL, ADMIN_PASSWORD
  • SSL certificate and reverse proxy knowledge for production deployments

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 prestashop:
3 image: prestashop/prestashop:latest
4 container_name: prestashop
5 restart: unless-stopped
6 ports:
7 - "${PS_PORT:-8080}:80"
8 environment:
9 - DB_SERVER=ps-mysql
10 - DB_NAME=prestashop
11 - DB_USER=${DB_USER}
12 - DB_PASSWD=${DB_PASSWORD}
13 - PS_INSTALL_AUTO=1
14 - PS_DOMAIN=localhost:${PS_PORT:-8080}
15 - PS_FOLDER_ADMIN=admin_secure
16 - ADMIN_MAIL=${ADMIN_EMAIL}
17 - ADMIN_PASSWD=${ADMIN_PASSWORD}
18 volumes:
19 - prestashop_data:/var/www/html
20 depends_on:
21 - ps-mysql
22
23 ps-mysql:
24 image: mysql:8.0
25 container_name: ps-mysql
26 restart: unless-stopped
27 environment:
28 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
29 - MYSQL_DATABASE=prestashop
30 - MYSQL_USER=${DB_USER}
31 - MYSQL_PASSWORD=${DB_PASSWORD}
32 volumes:
33 - mysql_data:/var/lib/mysql
34
35 elasticsearch:
36 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
37 container_name: ps-elasticsearch
38 restart: unless-stopped
39 environment:
40 - discovery.type=single-node
41 - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
42 volumes:
43 - es_data:/usr/share/elasticsearch/data
44
45volumes:
46 prestashop_data:
47 mysql_data:
48 es_data:

.env Template

.env
1# PrestaShop
2PS_PORT=8080
3DB_USER=prestashop
4DB_PASSWORD=ps_password
5DB_ROOT_PASSWORD=root_password
6ADMIN_EMAIL=admin@example.com
7ADMIN_PASSWORD=admin_password

Usage Notes

  1. 1Docs: https://devdocs.prestashop-project.org/
  2. 2Store at http://localhost:8080, admin at /admin_secure
  3. 3Delete /install folder after setup (security requirement)
  4. 4Enable Elasticsearch in Shop Parameters > Search for better performance
  5. 5Install modules from PrestaShop Addons marketplace
  6. 6Built-in multi-store and multi-language support

Individual Services(3 services)

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

prestashop
prestashop:
  image: prestashop/prestashop:latest
  container_name: prestashop
  restart: unless-stopped
  ports:
    - ${PS_PORT:-8080}:80
  environment:
    - DB_SERVER=ps-mysql
    - DB_NAME=prestashop
    - DB_USER=${DB_USER}
    - DB_PASSWD=${DB_PASSWORD}
    - PS_INSTALL_AUTO=1
    - PS_DOMAIN=localhost:${PS_PORT:-8080}
    - PS_FOLDER_ADMIN=admin_secure
    - ADMIN_MAIL=${ADMIN_EMAIL}
    - ADMIN_PASSWD=${ADMIN_PASSWORD}
  volumes:
    - prestashop_data:/var/www/html
  depends_on:
    - ps-mysql
ps-mysql
ps-mysql:
  image: mysql:8.0
  container_name: ps-mysql
  restart: unless-stopped
  environment:
    - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
    - MYSQL_DATABASE=prestashop
    - MYSQL_USER=${DB_USER}
    - MYSQL_PASSWORD=${DB_PASSWORD}
  volumes:
    - mysql_data:/var/lib/mysql
elasticsearch
elasticsearch:
  image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
  container_name: ps-elasticsearch
  restart: unless-stopped
  environment:
    - discovery.type=single-node
    - ES_JAVA_OPTS=-Xms256m -Xmx256m
  volumes:
    - es_data:/usr/share/elasticsearch/data

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 prestashop:
5 image: prestashop/prestashop:latest
6 container_name: prestashop
7 restart: unless-stopped
8 ports:
9 - "${PS_PORT:-8080}:80"
10 environment:
11 - DB_SERVER=ps-mysql
12 - DB_NAME=prestashop
13 - DB_USER=${DB_USER}
14 - DB_PASSWD=${DB_PASSWORD}
15 - PS_INSTALL_AUTO=1
16 - PS_DOMAIN=localhost:${PS_PORT:-8080}
17 - PS_FOLDER_ADMIN=admin_secure
18 - ADMIN_MAIL=${ADMIN_EMAIL}
19 - ADMIN_PASSWD=${ADMIN_PASSWORD}
20 volumes:
21 - prestashop_data:/var/www/html
22 depends_on:
23 - ps-mysql
24
25 ps-mysql:
26 image: mysql:8.0
27 container_name: ps-mysql
28 restart: unless-stopped
29 environment:
30 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
31 - MYSQL_DATABASE=prestashop
32 - MYSQL_USER=${DB_USER}
33 - MYSQL_PASSWORD=${DB_PASSWORD}
34 volumes:
35 - mysql_data:/var/lib/mysql
36
37 elasticsearch:
38 image: docker.elastic.co/elasticsearch/elasticsearch:7.17.0
39 container_name: ps-elasticsearch
40 restart: unless-stopped
41 environment:
42 - discovery.type=single-node
43 - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
44 volumes:
45 - es_data:/usr/share/elasticsearch/data
46
47volumes:
48 prestashop_data:
49 mysql_data:
50 es_data:
51EOF
52
53# 2. Create the .env file
54cat > .env << 'EOF'
55# PrestaShop
56PS_PORT=8080
57DB_USER=prestashop
58DB_PASSWORD=ps_password
59DB_ROOT_PASSWORD=root_password
60ADMIN_EMAIL=admin@example.com
61ADMIN_PASSWORD=admin_password
62EOF
63
64# 3. Start the services
65docker compose up -d
66
67# 4. View logs
68docker 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/prestashop-stack/run | bash

Troubleshooting

  • PrestaShop shows database connection error: Verify ps-mysql container is running and DB_* environment variables match MySQL configuration
  • Elasticsearch container exits with OutOfMemoryError: Increase Docker memory limits or reduce ES_JAVA_OPTS heap size from 256m
  • PrestaShop installation hangs at database setup: Check MySQL container logs for initialization completion before starting PrestaShop
  • Search functionality not working after Elasticsearch setup: Enable Elasticsearch module in PrestaShop admin under Shop Parameters > Search
  • Admin panel returns 404 error: Verify PS_FOLDER_ADMIN environment variable matches the actual admin folder name
  • Product images not displaying properly: Ensure prestashop_data volume has proper write permissions and sufficient disk space

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