Public | Automated Build

Last pushed: 3 minutes ago
Short Description
PrestaShop offers a free, fully scalable, Open-source e-commerce solution.
Full Description

PrestaShop on Docker

Supported tags

Image by PrestaShop version

  • 1.7, 1.7.1.1, latest
  • 1.6, 1.6.1.12
  • 1.5, 1.5.6.3
  • 1.4, 1.4.11.1

Other PHP versions

By default, our images are running with PHP 5.6. But each major version can be launched with another PHP version if you want to.

  • PHP 5.5: 1.5-5.5, 1.6-5.5, 1.7-5.5
  • PHP 7.0: 1.5-7.0, 1.6-7.0, 1.7-7.0

What is PrestaShop

PrestaShop is a free and open-source e-commerce web application, committed to providing the best shopping cart experience for both merchants and customers. It is written in PHP, is highly customizable, supports all the major payment services, is translated in many languages and localized for many countries, has a fully responsive design (both front and back office), etc. See all the available features.

www.prestashop.com

How to run this image

This image is running with the latest Apache version in the official PHP repository.

Important note: In order to follow Docker best-practices, the database will be shortly removed from the PrestaShop container and an external one will be required. You should immediately link a database container instead of using the internal one.

Currently, the most simple way to run this container is:

$ docker run -ti --name some-prestashop -p 8080:80 -d prestashop/prestashop

A new shop will be built, ready to be installed. You can then use it by reaching http://localhost:8080.
However, if you want to customize the container execution, here are many available options:

  • PS_DEV_MODE: The constant _PS_MODE_DEV_ will be set at true (default value: 0)
  • PS_HOST_MODE: The constant _PS_HOST_MODE_ will be set at true. Usefull to simulate a PrestaShop Cloud environment. (default value: 0)
  • DB_SERVER: If set, the external MySQL database will be used instead of the volatile internal one (default value: localhost)
  • DB_USER: Override default MySQL user (default value: root)
  • DB_PASSWD: Override default MySQL password (default value: admin)
  • DB_PREFIX: Override default tables prefix (default value: ps_)
  • DB_NAME: Override default database name (default value: prestashop)
  • PS_INSTALL_AUTO=1: The installation will be executed. Useful to initialize your image faster. (Please note that PrestaShop can be installed automatically from PS 1.5)
  • PS_LANGUAGE: Change the default language installed with PrestaShop (default value: en)
  • PS_COUNTRY: Change the default country installed with PrestaShop (default value: gb)
  • PS_FOLDER_ADMIN: Change the name of the admin folder (default value: admin. But will be automatically changed later)
  • PS_FOLDER_INSTALL: Change the name of the install folder (default value: install. But must be changed anyway later)

By default, we use the employee existing on the PrestaShop demo. But you can change it with the following parameters:

  • ADMIN_MAIL: Override default admin email (default value: demo@prestashop.com)
  • ADMIN_PASSWD: Override default admin password (default value: prestashop_demo)

If your IP / port (or domain) change between two executions of your container, you will need to modify this option:

  • PS_HANDLE_DYNAMIC_DOMAIN: Add specific configuration to handle dynamic domain (default value: 0)

License

View license information for the software contained in this image.

Documentation

The documentation (in English by default) is available at the following addresses:

Docker Pull Command
Owner
prestashop
Source Repository

Comments (12)
pipo1000
2 months ago

Also what is the easiest way to switch PHP version within the same version of Prestashop? Thanks!

pipo1000
2 months ago

I tried prestashop running on Docker on my Linux server while connecting to it from my Windows pc. However when I try to browse on my Windows PC to the Linux server with http://192.168.2.45:8080 the first response I get from Prestashop running within Docker is a redirect to http://172.17.0.2/index.php? which will not work when you are connecting from a remote Windows PC running a browser. Any ideas to fix this?

quetzacoalt
6 months ago

Hi kalmenchia,

You problem is normal, this is because you do not link the sql serveur port in your local environment.
To do so, you just have to add -p 3307:3306 in your command. You will be able to reach it with the address localhost:3307.

If you need to add parameters to your command, please write them BEFORE the "prestashop/prestashop[:tag]". Here is an example of command with params:

docker run -ti -e PS_DOMAIN=localhost:8080 -e PS_INSTALL_AUTO=1 -p 8080:80 prestashop/prestashop:1.7
kalmenchia
9 months ago

Hi ,

i have followed the above instruction and run the prestashop docker with

  • docker run -ti --name some-prestashop -p 8080:80 -d prestashop/prestashop

and got it run till the database creation page and cannot pass it , i tried to use the mysql client to connect but could not and port scan also did not show port is opened , only Docker port and 8080 port is opened , is there anything i missed ?

And all the parameters option above is it we pass it after the prestashop ?
i.e. docker run -ti --name some-prestashop -p 8080:80 -d prestashop/prestashop[:tag] PS_DEV_MODE:1 PS_HOST_MODE:1 ... ?

thanks for all advice.

cgdobre
9 months ago

Please update the apache start command to service apache2 start.

Right now at least tag 1.6.1.6 fails with :
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

because you start it using the binary not the service.

Thanks!

thsdrouot
9 months ago

To do it with docker-compose and persistent data (volumes), I pushed my repo :

https://github.com/Appliveso/docker-compose-prestashop

Its works fine normally !

aborilov
a year ago

I see you add DBPORT env, but it's not helped, because I can't change port of external mysql(https://hub.docker.com//mysql don't have such env), it helped if DB_PORT changed port of internal mysql or there are no internal mysql at all. When you plan to remove it, can't use before that happened.

aborilov
a year ago

can't use this image in kubernetes, because of internal mysql server, external mysql won't start because of port conflict with internal mysql server.

olivierguilloux
a year ago

Hello,

Two questions :

  • Why the internal database can only be volatile ?
  • The database configuration is save in config/settings.inc.php which is not part of a VOLUME. How fix this ?

Regards

quetzacoalt
a year ago

Hi seifbassem,

This feature is only available from PrestaShop 1.5. Also you have to write -e PS_INSTALL_AUTO=1 in order to enable it.