docker.recipes

PrestaShop E-commerce Platform

intermediate

Open source e-commerce with PrestaShop, MySQL, and caching.

Overview

PrestaShop is a feature-rich open-source e-commerce platform written in PHP that powers over 300,000 online stores worldwide. Originally launched in 2007, PrestaShop offers a comprehensive solution for building and managing online stores with support for multiple languages, currencies, and payment gateways. The platform includes built-in SEO tools, product catalog management, order processing, customer management, and a modular architecture with thousands of available themes and modules. This stack combines PrestaShop with MySQL for robust data storage, Redis for high-performance caching and session management, NGINX as a high-performance web server and reverse proxy, and phpMyAdmin for database administration. The MySQL database handles all product data, customer information, orders, and configuration settings, while Redis significantly improves page load times by caching frequently accessed data and storing user sessions. NGINX serves static assets efficiently and handles SSL termination, providing better performance than Apache for high-traffic scenarios. This combination is ideal for merchants launching new online stores, developers building e-commerce solutions for clients, or businesses migrating from hosted platforms to self-managed infrastructure. The stack provides enterprise-level performance and scalability while maintaining the flexibility to customize every aspect of the shopping experience, from checkout flows to inventory management.

Key Features

  • Multi-store management allowing multiple shops from single PrestaShop installation
  • Redis-powered session storage and object caching for improved checkout performance
  • MySQL InnoDB storage engine with ACID compliance for reliable transaction processing
  • NGINX FastCGI processing with optimized PHP-FPM integration for PrestaShop
  • phpMyAdmin interface for managing product catalogs, customer data, and order history
  • PrestaShop's built-in multi-language and multi-currency support with localized URLs
  • Redis Pub/Sub messaging for real-time inventory updates across multiple store instances
  • NGINX rate limiting and connection throttling to prevent cart abandonment during traffic spikes

Common Use Cases

  • 1Small to medium online retailers launching their first e-commerce website
  • 2Digital agencies building custom e-commerce solutions for multiple clients
  • 3Existing merchants migrating from Shopify or WooCommerce to self-hosted platform
  • 4Multi-brand retailers managing separate storefronts with shared inventory
  • 5International businesses requiring multi-language and multi-currency support
  • 6Developers creating custom B2B e-commerce portals with specialized pricing logic
  • 7Fashion and electronics retailers needing advanced product variation management

Prerequisites

  • Docker Engine 20.10+ and Docker Compose 2.0+ installed on host system
  • Minimum 2GB RAM available (MySQL 1GB, PrestaShop 512MB, Redis 256MB, NGINX 128MB)
  • Ports 80, 443, and 8081 available on host system for web and database access
  • Basic understanding of PHP application deployment and MySQL database management
  • SSL certificate files if enabling HTTPS in production environment
  • NGINX configuration knowledge for customizing reverse proxy and caching rules

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.0
4 environment:
5 - MYSQL_DATABASE=prestashop
6 - MYSQL_USER=prestashop
7 - MYSQL_PASSWORD=${MYSQL_PASSWORD}
8 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
9 volumes:
10 - mysql_data:/var/lib/mysql
11 networks:
12 - prestashop_net
13
14 redis:
15 image: redis:7-alpine
16 volumes:
17 - redis_data:/data
18 networks:
19 - prestashop_net
20
21 prestashop:
22 image: prestashop/prestashop:latest
23 environment:
24 - DB_SERVER=mysql
25 - DB_NAME=prestashop
26 - DB_USER=prestashop
27 - DB_PASSWD=${MYSQL_PASSWORD}
28 - PS_DOMAIN=localhost
29 - PS_FOLDER_ADMIN=admin123
30 - PS_FOLDER_INSTALL=install
31 - PS_ENABLE_SSL=0
32 volumes:
33 - prestashop_data:/var/www/html
34 depends_on:
35 - mysql
36 networks:
37 - prestashop_net
38
39 nginx:
40 image: nginx:alpine
41 ports:
42 - "80:80"
43 - "443:443"
44 volumes:
45 - ./nginx.conf:/etc/nginx/nginx.conf:ro
46 - prestashop_data:/var/www/html:ro
47 depends_on:
48 - prestashop
49 networks:
50 - prestashop_net
51
52 phpmyadmin:
53 image: phpmyadmin:latest
54 ports:
55 - "8081:80"
56 environment:
57 - PMA_HOST=mysql
58 depends_on:
59 - mysql
60 networks:
61 - prestashop_net
62
63volumes:
64 mysql_data:
65 redis_data:
66 prestashop_data:
67
68networks:
69 prestashop_net:

.env Template

.env
1# PrestaShop
2MYSQL_PASSWORD=secure_mysql_password
3MYSQL_ROOT_PASSWORD=secure_root_password
4
5# Shop at http://localhost
6# Admin at http://localhost/admin123
7# Delete /install after setup

Usage Notes

  1. 1Shop at http://localhost
  2. 2Admin at http://localhost/admin123
  3. 3Complete installation wizard first
  4. 4Delete /install folder after setup
  5. 5Configure caching modules for Redis

Individual Services(5 services)

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

mysql
mysql:
  image: mysql:8.0
  environment:
    - MYSQL_DATABASE=prestashop
    - MYSQL_USER=prestashop
    - MYSQL_PASSWORD=${MYSQL_PASSWORD}
    - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
  volumes:
    - mysql_data:/var/lib/mysql
  networks:
    - prestashop_net
redis
redis:
  image: redis:7-alpine
  volumes:
    - redis_data:/data
  networks:
    - prestashop_net
prestashop
prestashop:
  image: prestashop/prestashop:latest
  environment:
    - DB_SERVER=mysql
    - DB_NAME=prestashop
    - DB_USER=prestashop
    - DB_PASSWD=${MYSQL_PASSWORD}
    - PS_DOMAIN=localhost
    - PS_FOLDER_ADMIN=admin123
    - PS_FOLDER_INSTALL=install
    - PS_ENABLE_SSL=0
  volumes:
    - prestashop_data:/var/www/html
  depends_on:
    - mysql
  networks:
    - prestashop_net
nginx
nginx:
  image: nginx:alpine
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
    - prestashop_data:/var/www/html:ro
  depends_on:
    - prestashop
  networks:
    - prestashop_net
phpmyadmin
phpmyadmin:
  image: phpmyadmin:latest
  ports:
    - "8081:80"
  environment:
    - PMA_HOST=mysql
  depends_on:
    - mysql
  networks:
    - prestashop_net

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 mysql:
5 image: mysql:8.0
6 environment:
7 - MYSQL_DATABASE=prestashop
8 - MYSQL_USER=prestashop
9 - MYSQL_PASSWORD=${MYSQL_PASSWORD}
10 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
11 volumes:
12 - mysql_data:/var/lib/mysql
13 networks:
14 - prestashop_net
15
16 redis:
17 image: redis:7-alpine
18 volumes:
19 - redis_data:/data
20 networks:
21 - prestashop_net
22
23 prestashop:
24 image: prestashop/prestashop:latest
25 environment:
26 - DB_SERVER=mysql
27 - DB_NAME=prestashop
28 - DB_USER=prestashop
29 - DB_PASSWD=${MYSQL_PASSWORD}
30 - PS_DOMAIN=localhost
31 - PS_FOLDER_ADMIN=admin123
32 - PS_FOLDER_INSTALL=install
33 - PS_ENABLE_SSL=0
34 volumes:
35 - prestashop_data:/var/www/html
36 depends_on:
37 - mysql
38 networks:
39 - prestashop_net
40
41 nginx:
42 image: nginx:alpine
43 ports:
44 - "80:80"
45 - "443:443"
46 volumes:
47 - ./nginx.conf:/etc/nginx/nginx.conf:ro
48 - prestashop_data:/var/www/html:ro
49 depends_on:
50 - prestashop
51 networks:
52 - prestashop_net
53
54 phpmyadmin:
55 image: phpmyadmin:latest
56 ports:
57 - "8081:80"
58 environment:
59 - PMA_HOST=mysql
60 depends_on:
61 - mysql
62 networks:
63 - prestashop_net
64
65volumes:
66 mysql_data:
67 redis_data:
68 prestashop_data:
69
70networks:
71 prestashop_net:
72EOF
73
74# 2. Create the .env file
75cat > .env << 'EOF'
76# PrestaShop
77MYSQL_PASSWORD=secure_mysql_password
78MYSQL_ROOT_PASSWORD=secure_root_password
79
80# Shop at http://localhost
81# Admin at http://localhost/admin123
82# Delete /install after setup
83EOF
84
85# 3. Start the services
86docker compose up -d
87
88# 4. View logs
89docker 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-complete/run | bash

Troubleshooting

  • PrestaShop installation wizard shows database connection error: Verify MYSQL_PASSWORD environment variable matches DB_PASSWD in PrestaShop service
  • Products and categories load slowly after initial setup: Enable PrestaShop's Redis cache module in Back Office > Advanced Parameters > Performance
  • NGINX shows 502 Bad Gateway during PrestaShop container startup: Add health check or increase NGINX upstream timeout in configuration file
  • phpMyAdmin cannot connect to database: Ensure both services are on prestashop_net network and PMA_HOST matches MySQL service name
  • PrestaShop admin panel redirects to installation wizard: Remove install folder from prestashop_data volume and restart container
  • Redis connection fails in PrestaShop cache settings: Configure cache servers with redis:6379 as server address in Performance settings

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