docker.recipes

Bagisto E-commerce Platform

intermediate

Bagisto Laravel e-commerce with MySQL.

Overview

Bagisto is a modern, Laravel-based e-commerce framework that provides a complete foundation for building online stores and marketplaces. Developed by Webkul, Bagisto offers multi-channel selling capabilities, comprehensive inventory management, and built-in support for multi-vendor marketplaces, making it a powerful alternative to Magento or WooCommerce for businesses seeking a flexible PHP-based e-commerce solution. This Docker stack combines Bagisto with MySQL 8.0 for robust relational data storage, Redis for high-speed caching and session management, and Nginx as a reverse proxy to handle web traffic efficiently. The MySQL database stores product catalogs, customer data, and order information with full ACID compliance, while Redis accelerates page load times by caching frequently accessed data and managing user sessions. Nginx serves as the front-end web server, handling static assets and proxying PHP requests to the Bagisto application container. This configuration is ideal for e-commerce businesses, Laravel developers building custom online stores, agencies deploying client shopping platforms, and entrepreneurs launching multi-vendor marketplaces who need a scalable, feature-rich e-commerce solution with professional-grade performance optimization.

Key Features

  • Multi-channel selling with support for web, mobile, and social commerce platforms
  • Built-in multi-vendor marketplace functionality with vendor management and commission tracking
  • Advanced inventory management with configurable products, bundles, and downloadable goods
  • MySQL InnoDB storage engine with full-text search capabilities for product catalogs
  • Redis-powered session storage and Laravel cache optimization for sub-millisecond response times
  • Nginx reverse proxy with HTTP/2 support and static asset optimization
  • Laravel Artisan command-line tools for migrations, seeding, and custom development
  • Comprehensive admin panel with role-based permissions and multi-language support

Common Use Cases

  • 1Small to medium businesses launching their first professional online store
  • 2Multi-vendor marketplaces requiring commission management and vendor dashboards
  • 3Laravel developers building custom e-commerce solutions for clients
  • 4Agencies migrating clients from Magento or Shopify to a self-hosted platform
  • 5B2B companies needing advanced inventory management and bulk ordering capabilities
  • 6International retailers requiring multi-currency and multi-language support
  • 7Developers prototyping e-commerce features in a local development environment

Prerequisites

  • Docker and Docker Compose installed on the host system
  • Minimum 2GB RAM available (1GB+ for MySQL, 512MB+ for Redis, remainder for Bagisto and Nginx)
  • Port 80 available for web traffic (or configure custom port via NGINX_PORT)
  • Basic understanding of Laravel framework and PHP development practices
  • Database administration knowledge for MySQL backup and maintenance procedures
  • SSL certificate and domain configuration 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 bagisto:
3 image: bagisto/bagisto:latest
4 container_name: bagisto
5 restart: unless-stopped
6 environment:
7 - DB_HOST=bagisto-mysql
8 - DB_DATABASE=bagisto
9 - DB_USERNAME=${DB_USER}
10 - DB_PASSWORD=${DB_PASSWORD}
11 - REDIS_HOST=bagisto-redis
12 volumes:
13 - bagisto_storage:/var/www/html/storage
14 depends_on:
15 - bagisto-mysql
16 - bagisto-redis
17
18 bagisto-mysql:
19 image: mysql:8.0
20 container_name: bagisto-mysql
21 restart: unless-stopped
22 environment:
23 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
24 - MYSQL_DATABASE=bagisto
25 - MYSQL_USER=${DB_USER}
26 - MYSQL_PASSWORD=${DB_PASSWORD}
27 volumes:
28 - mysql_data:/var/lib/mysql
29
30 bagisto-redis:
31 image: redis:7-alpine
32 container_name: bagisto-redis
33 restart: unless-stopped
34 volumes:
35 - redis_data:/data
36
37 nginx:
38 image: nginx:alpine
39 container_name: bagisto-nginx
40 restart: unless-stopped
41 ports:
42 - "${NGINX_PORT:-80}:80"
43 volumes:
44 - ./nginx.conf:/etc/nginx/nginx.conf:ro
45 depends_on:
46 - bagisto
47
48volumes:
49 bagisto_storage:
50 mysql_data:
51 redis_data:

.env Template

.env
1# Bagisto
2NGINX_PORT=80
3DB_USER=bagisto
4DB_PASSWORD=bagisto_password
5DB_ROOT_PASSWORD=root_password

Usage Notes

  1. 1Docs: https://devdocs.bagisto.com/
  2. 2Store at http://localhost, admin panel at /admin
  3. 3Complete web installer wizard on first visit
  4. 4Default admin: admin@example.com / admin123 - change immediately
  5. 5Laravel Artisan: docker exec bagisto php artisan
  6. 6Multi-vendor marketplace capabilities available

Individual Services(4 services)

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

bagisto
bagisto:
  image: bagisto/bagisto:latest
  container_name: bagisto
  restart: unless-stopped
  environment:
    - DB_HOST=bagisto-mysql
    - DB_DATABASE=bagisto
    - DB_USERNAME=${DB_USER}
    - DB_PASSWORD=${DB_PASSWORD}
    - REDIS_HOST=bagisto-redis
  volumes:
    - bagisto_storage:/var/www/html/storage
  depends_on:
    - bagisto-mysql
    - bagisto-redis
bagisto-mysql
bagisto-mysql:
  image: mysql:8.0
  container_name: bagisto-mysql
  restart: unless-stopped
  environment:
    - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
    - MYSQL_DATABASE=bagisto
    - MYSQL_USER=${DB_USER}
    - MYSQL_PASSWORD=${DB_PASSWORD}
  volumes:
    - mysql_data:/var/lib/mysql
bagisto-redis
bagisto-redis:
  image: redis:7-alpine
  container_name: bagisto-redis
  restart: unless-stopped
  volumes:
    - redis_data:/data
nginx
nginx:
  image: nginx:alpine
  container_name: bagisto-nginx
  restart: unless-stopped
  ports:
    - ${NGINX_PORT:-80}:80
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
  depends_on:
    - bagisto

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 bagisto:
5 image: bagisto/bagisto:latest
6 container_name: bagisto
7 restart: unless-stopped
8 environment:
9 - DB_HOST=bagisto-mysql
10 - DB_DATABASE=bagisto
11 - DB_USERNAME=${DB_USER}
12 - DB_PASSWORD=${DB_PASSWORD}
13 - REDIS_HOST=bagisto-redis
14 volumes:
15 - bagisto_storage:/var/www/html/storage
16 depends_on:
17 - bagisto-mysql
18 - bagisto-redis
19
20 bagisto-mysql:
21 image: mysql:8.0
22 container_name: bagisto-mysql
23 restart: unless-stopped
24 environment:
25 - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
26 - MYSQL_DATABASE=bagisto
27 - MYSQL_USER=${DB_USER}
28 - MYSQL_PASSWORD=${DB_PASSWORD}
29 volumes:
30 - mysql_data:/var/lib/mysql
31
32 bagisto-redis:
33 image: redis:7-alpine
34 container_name: bagisto-redis
35 restart: unless-stopped
36 volumes:
37 - redis_data:/data
38
39 nginx:
40 image: nginx:alpine
41 container_name: bagisto-nginx
42 restart: unless-stopped
43 ports:
44 - "${NGINX_PORT:-80}:80"
45 volumes:
46 - ./nginx.conf:/etc/nginx/nginx.conf:ro
47 depends_on:
48 - bagisto
49
50volumes:
51 bagisto_storage:
52 mysql_data:
53 redis_data:
54EOF
55
56# 2. Create the .env file
57cat > .env << 'EOF'
58# Bagisto
59NGINX_PORT=80
60DB_USER=bagisto
61DB_PASSWORD=bagisto_password
62DB_ROOT_PASSWORD=root_password
63EOF
64
65# 3. Start the services
66docker compose up -d
67
68# 4. View logs
69docker 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/bagisto-ecommerce-stack/run | bash

Troubleshooting

  • Bagisto shows database connection error: Verify DB_HOST, DB_USERNAME, and DB_PASSWORD environment variables match MySQL container settings
  • Web installer fails during setup: Check MySQL container is fully initialized by examining logs with docker logs bagisto-mysql
  • Laravel cache issues or session problems: Restart Redis container and clear Laravel cache with docker exec bagisto php artisan cache:clear
  • Nginx 502 Bad Gateway errors: Ensure Bagisto container is running and accessible on its internal network port
  • File upload or storage permissions errors: Verify bagisto_storage volume is properly mounted and container has write permissions
  • Performance issues with large catalogs: Increase MySQL innodb_buffer_pool_size and configure Redis maxmemory settings based on available RAM

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