Skip to content

Instantly share code, notes, and snippets.

@lmeyer1
Last active January 20, 2023 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmeyer1/c40a19d880758bee11a1e8a2c5e819c3 to your computer and use it in GitHub Desktop.
Save lmeyer1/c40a19d880758bee11a1e8a2c5e819c3 to your computer and use it in GitHub Desktop.

Running Prestashop in Docker

We are using the image here: https://hub.docker.com/r/prestashop/prestashop/

How to get up and running:

  1. Install Docker https://docs.docker.com/desktop/install/windows-install/
  2. Docker asks to upgrade WSL (Linux subsystem for Windows) https://learn.microsoft.com/fr-fr/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
  3. Restart computer
  4. Create a network docker network create prestashop-net

Create the containers for Prestashop 8.0

docker network create prestashop-net
docker run -ti --name ps8-mysql --network prestashop-net -e MYSQL_ROOT_PASSWORD=admin -p 3307:3306 -d mysql:5.7
docker run -ti --name ps8-prestashop --network prestashop-net -e DB_SERVER=ps8-mysql -p 8080:80 -d prestashop/prestashop
docker run --network prestashop-net --name phpmyadmin -d -e MYSQL_ROOT_PASSWORD=admin --link ps8-mysql:db -p 8081:80 phpmyadmin

For Prestashop 1.7

docker network create prestashop-17
docker run -ti --name ps17-mysql --network prestashop-17 -e MYSQL_ROOT_PASSWORD=admin -p 3308:3306 -d mysql:5.7
docker run -ti --name ps17-prestashop --network prestashop-17 -e DB_SERVER=ps17-mysql -p 8017:80 -d prestashop/prestashop:1.7
docker run --network prestashop-17 --name phpmyadmin-17 -d -e MYSQL_ROOT_PASSWORD=admin --link ps17-mysql:db -p 8018:80 phpmyadmin

Once the containers in place, navigate to localhost:8080 and localhost:8017 to install PrestaShop.

  • Name the shop Prestashop default
  • Choose Switzerland as country to get French and German as language 1 and 2.
  • On the database configuration page enter ps8-mysql or ps17-mysql as hostname and admin as root password, then create the database prestashop.

Then, in the Docker UI, on the line of the PrestaShop installation, click on Three dots - Open in terminal, then rename install and admin folder (mv install install-dev, mv admin admin-dev).

Basic multishop setup

  1. Add the English language (Required only for PS 1.7.8, in PS 8.0, it is already installed when selecting Switzerlandduring installation).

    • Add English (US) as a new language: In International - Translation under Add / Update a language select English.
    • In your profile, select English as your language
  2. In Shop parameters - General set Enable Multistore to Yes

  3. Goto Advanced Parameters - Multistore

  4. Create shop 2 with name Shop A and URL localhost:8017/shop-a (Virtual URL = shop-a)

  5. Create shop 3 with name Shop B and URL localhost:8017/shop-b (Virtual URL = shop-b)

We now have three shops: Prestashop default, Shop A and Shop B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment