Prestashop Docker Compose
PrestaShop is a free and open-source e-commerce platform that allows individuals and businesses to create online stores and sell products and services. It was first released in 2007 and has since become one of the most widely used e-commerce platforms in the world, with a large community of developers and users.
PrestaShop is written in PHP and uses a MySQL database. It is available in multiple languages and can be customized to meet the specific needs of different businesses and industries.
To make some development, it can be useful to deploy a local environment. One way is to create a local Docker environment. Prestashop provides an official Docker image. Prestashop support main versions for now which are Prestashop 1.7 (1.7.x) and Prestashop 8 (8.x). Let's see how to a create local environment for those both versions.
If you just need to start a shop and you do not want to manage the hosting, you still can launch your store with Prestashop managed hosting Edition.
Docker Compose for Prestashop 8
Here you can find a docker-compose
file with the Prestashop 8 image and a MySQL database. The installation is automatically installed with a demo shop ready to play with.
version: "3"
services:
prestashop:
image: prestashop/prestashop:8-apache
environment:
- DB_SERVER=db
- DB_NAME=prestashop
- DB_USER=prestashop
- DB_PASSWD=prestashop
- PS_DEV_MODE=1
- PS_DEMO_MODE=1
- PS_INSTALL_AUTO=1
- PS_DOMAIN=localhost:8080
- PS_FOLDER_ADMIN=admin
- [email protected]
- ADMIN_PASSWD=prestashop_demo
links:
- db
depends_on:
- db
ports:
- 8080:80
networks:
- prestashop-net
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080" ]
interval: 30s
timeout: 10s
retries: 5
db:
image: mysql:8
command: --default-authentication-plugin=caching_sha2_password
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=prestashop
- MYSQL_USER=prestashop
- MYSQL_PASSWORD=prestashop
networks:
- prestashop-net
networks:
prestashop-net:
Docker Compose for Prestashop 1.7
Here you can find a docker-compose
file for Prestashop 1.7
version: "3"
services:
prestashop:
image: prestashop/prestashop:1.7
environment:
- DB_SERVER=db
- DB_NAME=prestashop
- DB_USER=prestashop
- DB_PASSWD=prestashop
- PS_DEV_MODE=1
- PS_DEMO_MODE=1
- PS_INSTALL_AUTO=1
- PS_DOMAIN=localhost:8080
- PS_FOLDER_ADMIN=admin
- [email protected]
- ADMIN_PASSWD=prestashop_demo
links:
- db
depends_on:
- db
ports:
- 8080:80
networks:
- prestashop-net
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080" ]
interval: 30s
timeout: 10s
retries: 5
db:
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=admin
- MYSQL_DATABASE=prestashop
- MYSQL_USER=prestashop
- MYSQL_PASSWORD=prestashop
networks:
- prestashop-net
networks:
prestashop-net:
Here is more documentation about the Prestashop Docker image.
Consulting
If you're seeking solutions to a problem or need expert advice, I'm here to help! Don't hesitate to book a call with me for a consulting session. Let's discuss your situation and find the best solution together.