Giter Club home page Giter Club logo

docker's Introduction

PrestaShop on Docker

Tests Codestyle

Supported tags

Images by PrestaShop version

  • 8, latest, 8-apache
  • 8-fpm
  • nightly (Latest but unstable release from git)

You can use tags for this. For example:

docker run -ti --name my-docker-name -e PS_DEV_MODE=false -e PS_INSTALL_AUTO=0 -p 8080:80 -d prestashop/prestashop:8.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-project.org

PrestaShop's back office dashboard

How to run these images

These images are running with the latest version in the official PHP repository. For the database, you can use and link any SQL server related to MySQL.

Currently if you do not have any MySQL server, the most simple way to run this container is:

# create a network for containers to communicate
docker network create prestashop-net
# launch mysql 5.7 container
docker run -ti --name some-mysql --network prestashop-net -e MYSQL_ROOT_PASSWORD=admin -p 3307:3306 -d mysql:5.7
# launch prestashop container
docker run -ti --name some-prestashop --network prestashop-net -e DB_SERVER=some-mysql -p 8080:80 -d prestashop/prestashop:latest

A new shop will be built, ready to be installed.

You can then use the shop by reaching http://localhost:8080.

The MySQL server can be reached:

  • from the host using port 3307 (example: $ mysql -uroot -padmin -h localhost --port 3307)
  • from a container in the network using the URL some-mysql.

For example, when you reach the "database configuration" install step, the installer will ask for the "server database address": input some-mysql.


However, if you want to customize the container execution, here are many available options:

Environment variable Description Default value
PS_DEV_MODE The constant PS_MODE_DEV will be set at true 0
PS_HOST_MODE The constant PS_HOST_MODE will be set at true. Useful to simulate a PrestaShop Cloud environment. 0
PS_DEMO_MODE The constant PS_DEMO_MODE will be set at true. Use it to create a demonstration shop. 0
DB_SERVER If set, the external MySQL database will be used instead of the volatile internal one localhost
DB_USER Override default MySQL user root
DB_PASSWD Override default MySQL password admin
DB_PREFIX Override default tables prefix ps_
DB_NAME Override default database name prestashop
PS_INSTALL_AUTO The installation will be executed. Useful to initialize your image faster. In some configurations, you may need to set PS_DOMAIN or PS_HANDLE_DYNAMIC_DOMAIN as well. (Please note that PrestaShop can be installed automatically from PS 1.5) 0
PS_ERASE_DB Drop the mysql database. All previous mysql data will be lost 0
PS_INSTALL_DB Create the mysql database. 0
PS_DOMAIN When installing automatically your shop, you can tell the shop how it will be reached. For advanced users only
PS_LANGUAGE Change the default language installed with PrestaShop en
PS_COUNTRY Change the default country installed with PrestaShop GB
PS_ALL_LANGUAGES Install all the existing languages for the current version. 0
PS_FOLDER_ADMIN Change the name of the admin folder admin
PS_FOLDER_INSTALL Change the name of the install folder install
PS_ENABLE_SSL Enable SSL at PrestaShop installation. 0
ADMIN_MAIL Override default admin email [email protected]
ADMIN_PASSWD Override default admin password prestashop_demo

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

Environment variable Description Default value
PS_HANDLE_DYNAMIC_DOMAIN Add specific configuration to handle dynamic domain 0

Documentation

The user documentation (in English by default) is available here.

The developer documentation (English only) can be found here.

Troubleshooting

Prestashop cannot be reached from the host browser

When using Docker for Mac or Docker for Windows (throught WSL), Prestashop cannot be reached from the host browser (gets redirected to "dockeripaddress:8080")

Docker for Mac has an issue with bridging networking and consequently cannot reach the container on its internal IP address. After installation, the browser on the host machine will be redirected from http://localhost:8080 to http://<internal_prestashop_container_ip>:8080 which fails.

You need to set the PS_DOMAIN variable to localhost:8080 for it to work correctly when browsing from the host computer. The command looks something like this:

docker run -ti --name some-prestashop --network prestashop-net -e DB_SERVER=some-mysql -e PS_DOMAIN=localhost:8080 -p 8080:80 -d prestashop/prestashop

Cannot connect to mysql from host - authentication plugin cannot be loaded

ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: ...

If your mysql image uses MySQL 8, the authentication plugin changed from mysql_native_password to caching_sha2_password. You can bypass this by forcing the old authentication plugin:

docker run -ti -p 3307:3306 --network prestashop-net --name some-mysql -e MYSQL_ROOT_PASSWORD=admin -d mysql --default-authentication-plugin=mysql_native_password

Cannot connect to mysql from host - cannot use socket

ERROR 1045 (28000): Access denied for user '...'@'...' (using password: YES)

For some usecases, you might need to force using TCP instead of sockets:

mysql -u root -padmin -h localhost --port 3307 --protocol=tcp

During the installation, prestashop cannot connect to mysql - bad charset

Server sent charset (255) unknown to the client. Please, report to the developers

MySQL 8 changed the default charset to utfmb4. But some clients do not know this charset. This requires to modify the mysql configuration file.

If you are using a mysql container, you need to :

  • modify mysql configuration file /etc/mysql/my/cnf and add:
[client]
default-character-set=utf8

[mysql]
default-character-set=utf8


[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
  • restart mysql container

How to use the builder script

For more information, read HOW-TO-USE.md file

docker's People

Contributors

atomiix avatar bigbrozer avatar davidglezz avatar dependabot[bot] avatar djodjo3 avatar dracito avatar fabienpapet avatar hugofintecture avatar jolelievre avatar jsshandle avatar matks avatar matthieu-rolland avatar matthieumota avatar maximebiloe avatar mflasquin avatar mwienk avatar nicosomb avatar phireiser avatar pierrerambaud avatar pimuzzo avatar poulainmaxime avatar progi1984 avatar ptt-homme avatar pululuk avatar quetzacoalt91 avatar sergioregueira avatar sharakpl avatar sowbiba avatar tibs245 avatar touxten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker's Issues

PHP [ Upload + Post ] Max Size configuration

Hi,

Is it possible to provide a way to configure php.ini with increased values for upload_max_filesize and post_max_size ? 8MB may not fit various use cases.

Thank you in advance,
Julian

Configuring prestashop single container. Can not find server database (DbPDO)

Hi guys,

I ran a new prestashop image through this command:

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

Then I tried to configure a new brand shop. When I tried to configure database, it seems cannot find server in that container:

Can not find server database. Please verify the user, password and server fields (DbPDO)

Does start docker container should start mysql service ?

Installing prestashop is not possible when using a reverse proxy

Hei,

I'm testing prestashop/prestashop:latest behind a reverse proxy (nginx-proxy), and the installDatabase operation timeouts after 30s (504 Gateway Time-out).

I guess I can restart the installation without a reverse proxy, but it's not very convenient.

Access denied for user 'root'@'localhost' (using password: NO)

When using PS_INSTALL_AUTO=1, doing a simple
docker run -ti -p 8080:80 prestashop/prestashop ends up in this error while trying to install the shop:

  • Installing PrestaShop, this may take a while ...
    Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

Any help on how to solve it? I just want to use it for development purposes, so for us it's ok to have the MySQL inside the same container

PS_HANDLE_DYNAMIC_DOMAIN is not taken into account

The following command in dcker_run.sh seems to have no effect

        sed -ie "s/DirectoryIndex\ index.php\ index.html/DirectoryIndex\ docker_updt_ps_domains.php\ index.php\ index.html/g" /etc/apache2/apache2.conf

This is because the apache2.conf file coming from docker php apache image has no such directive.

Add update_ps_shop_domain.php instead of deleting it

When we do not want the automatic update, we currently try to remove the dedicated file.
But when we use the container with a volume on /var/www/html, an error is displayed saying the file cannot be found.

We should instead add the file only when we request the feature.

auto install does not work

latest (1.6.1.0) doesn't install, starts with installation wizard
1.6.0 somethings going wrong, having Error: "install" directory is missing on start

(Using docker run -ti --name some-prestashop -p 8080:80 -d quetzacoalt/prestashop and docker run -ti --name some-prestashop2 -p 8081:80 -d quetzacoalt/prestashop:1.6.0 to run)

After stopping docker container it won't start again

I made a simple prestashop docker installation, here my docker compose file:

  prestashop:
  image: prestashop/prestashop
  hostname: shop.deliziaalessandro.it
  ports:
    - "8081:80"
  links:
    - mysql:mysql
  environment:
    DB_SERVER: mysql
    DB_USER: mysql
    DB_PASSWD: mysql
    DB_NAME: mysql
    PS_LANGUAGE: it
    PS_COUNTRY: it'

it starts correctly but when I stop and restart it, then it shutdown right after the startup. Here is the only output log:

* Almost ! Starting Apache now

httpd (pid 10) already running

I stop/start the container like this:

docker start <containerName>
docker stop <containerName>

The prestashop dir must be declared as a volume

Hi here,

It's very dangerous to put the config directory outside a docker volume, because the config/settings.inc.php is used to run installation (and drop mysql database). For example, I use docker-compose and the automatic installation :

  1. I install prestashop and configure it, everything is fine, my database is ok
  2. I change something into docker-compose.yml
  3. docker-compose up -d recreate the container, preserving volumes (module, override and theme) but restauring system container like the original image
  4. docker_run.sh is running and check if config/settings.inc.php exist (spoiler : no)
  5. docker_run.sh re-install prestashop (adding admin / install dir, etc.) and if auto install activated, drop et recreate database !

The 3 directories (config, admin and install) must be preserve between restart / recreating. And we can't mount a volume on /var/www/html because modules, override and themes are already volumes into /var/www/html.

I will try to do a quick PR about this. IMAO, we can move the override, modules and themes outside the /var/www/html (as volumes) and create symbolic links with the installer (and add a volume on /var/www/html, obviously). What do you think about this solution ?

ERR_TOO_MANY_REDIRECTS

Hello,
I try to install prestashop 1.7 with a nginx reverse proxy.
I can install the database, set the title of the site but when I try access to the site I always have this error "ERR_TOO_MANY_REDIRECTS" and I can't do anything...

Cordialy,
AM

redirect to IP started with 172. in version 1.7.1.1 when visit admin login page

as noted in comment by pipo1000 in https://hub.docker.com/r/prestashop/prestashop/

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?

running: (version: 1.6.1.13)

docker run -ti --name prestashop -e DB_SERVER=mysql5 -e DB_USER=root -e DB_PASSWD=pass -e DB_NAME=prestashop16 -e PS_INSTALL_AUTO=1 -e PS_FOLDER_ADMIN=adminlogin -e PS_FOLDER_INSTALL=installremoved -e [email protected] -e ADMIN_PASSWD=password1! -p 8082:80 -d prestashop/prestashop:1.6.1.13

will make visiting http://IP:8082/adminlogin/ work, while using the same command with version 1.7.1.1 will return redirect to IP started with 172. that is unresolved (from outside machine).
tested with: Ubuntu desktop as HOST OS. Ubuntu server as guest OS (that run the above docker command)

Recursive write permissions for volume "/var/www/html/modules"

Currently I am working with the following docker-compose.yml file:

version: "3"

services:
  mariadb:
    image: mariadb:10.3
    container_name: mariadb
    env_file:
      - .env

  prestashop:
    image: prestashop/prestashop:1.7
    container_name: prestashop
    volumes:
      - ./src:/var/www/html/modules/mylittlemodule
    ports:
      - 8080:80
    env_file:
      - .env

But when installing PrestaShop via GUI and I see the following message:

Recursive write permissions for www-data user on ~/modules/

So I tried to change permissions for the directory (inside the container) by executing the following command:

chown -R www-data:www-data /var/www/html/modules

But this didn't fixed the error, I am still seeing the same error. Any chance to solve the issue?

Error in 12% of the installation process

captura de pantalla 2015-10-31 a las 11 59 46

I am reading about errors in installation process and I found some approaches about this error, but I do not accomplish solve it. I checked permissions, changed the database, changed max_execution_time... but nothing seems working. Do you have any idea about it?

I've setup Prestashop 1.7.2.2 with PHP 5.6 but I want the 7.0

I've followed the tutorial to launch the Prestashop Docker with the PHP 7, by adding the Environment variable PHP_VERSION=1.7-7.0 set, yet I have the wrong PHP_VERSION on the Admin info page:
PHP Version: 5.6.31

I've executed with this command:

docker run -ti --name my-docker-name -e PHP_VERSION=1.7-7.0 -e PS_DEV_MODE=false -e PS_INSTALL_AUTO=0 -p 8080:80 -d prestashop/prestashop:latest

Also, I have the PHP Memory Limit of 128 mb, is that ok, or should I change as well?

Volumes doesn't work

Hi,

Works ok without volumes

but with it doesn't : -v /var/www/html:/var/www/html

some folders are created :

drwxr-xr-x 2 root root 4096 Oct 18 13:20 modules
drwxr-xr-x 2 root root 4096 Oct 18 13:20 override
drwxr-xr-x 2 root root 4096 Oct 18 13:20 themes

But : Could not open input file: /var/www/html/install-dev/index_cli.php

Thanks

Cannot enable SSL

I'm running PrestaShop v 1.7.1.2 via Docker.

When I try to enable SSL, by clicking the "Please, click here to check if your store supports SSL", the browser correctly redirects to https and loads the admin, but it never passes the check. If I check my console for log messages I find this:

Mixed Content: The page at 'https://www.mydomain.com.br/admin..../index.php?controller=AdminPreferences&token=eeee....' was loaded over HTTPS, but requested an insecure image 'http://profile.prestashop.com/username%40domain.tld.jpg'. This content should also be served over HTTPS.

Could this be the reason?

If you need further information, read on :)

I run PrestaShop with docker-compose. Here's the relevant part:

version: '2'
services:
  nginx:
    volumes:
      - /data/nginx:/etc/nginx/conf.d
      - /data/sites/:/sites
      - /data/nginx/dhparam.pem:/etc/nginx/ssl/dhparam.pem
      - /etc/letsencrypt/:/etc/letsencrypt/
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
    image: nginx

  mariadb:
    image: mariadb:10.1
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=xxx
      - MYSQL_DATABASE=xxx
      - MYSQL_USER=xxx
      - MYSQL_PASSWORD=xxx
    volumes:
      - /data/mysql/db:/var/lib/mysql

  prestashop:
    image: prestashop/prestashop
    ports:
      - 8081:80
    depends_on:
      - mariadb

As you can imagine, I use nginx as a reverse-proxy to my docker containers.
Here's the nginx part for the prestashop container:

server {
	listen 80;
	server_name mydomain.com www.mydomain.com;

	location /.well-known {
		root /sites/letsencrypt;
	}

        location / {
		client_max_body_size 32m;
                proxy_buffering off;
                proxy_http_version 1.1;
                proxy_read_timeout 600;
                proxy_send_timeout 600;
                proxy_set_header   Host             $host;
                proxy_set_header   Referer          $http_referer;
                proxy_set_header   X-Real-IP        $remote_addr;
                proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_set_header   Upgrade          $http_upgrade;
                proxy_set_header   Connection       "upgrade";
                proxy_set_header   X-Forward-Proto  http;
                proxy_set_header   X-Nginx-Proxy    true;
                proxy_redirect     off;
                proxy_pass         http://prestashop;
                if ($uri != '/') {
                        expires 30d;
                }
        }
}

server {
	listen 443;
	server_name mydomain.com www.mydomain.com;

	location /.well-known {
		root /sites/letsencrypt;
	}

	location / {
		client_max_body_size 32m;
		proxy_buffering off;
		proxy_http_version 1.1;
		proxy_read_timeout 600;
		proxy_send_timeout 600;
		proxy_set_header   Host             $host;
		proxy_set_header   Referer          $http_referer;
		proxy_set_header   X-Real-IP        $remote_addr;
		proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
		proxy_set_header   Upgrade          $http_upgrade;
		proxy_set_header   Connection       "upgrade";
		proxy_set_header   X-Forward-Proto  http;
		proxy_set_header   X-Nginx-Proxy    true;
		proxy_redirect     off;
		proxy_pass         http://prestashop;
		if ($uri != '/') {
			expires 30d;
		}
	}
	ssl on;

	ssl_certificate /etc/letsencrypt/live/mydomain.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/mydomain.com/privkey.pem;

	ssl_ciphers          'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
	ssl_prefer_server_ciphers on;
	ssl_dhparam          /etc/nginx/ssl/dhparam.pem;
}

Hopefully that's enough information to get started ;)

Docker PS_INSTALL_AUTO=1 Not working! :fire:

I'm trying to set up prestashop automatic mode using PS_INSTALL_AUTO=1 env.
But after doing the docker-compouse up, it does not work (empty database)! although there were no errors in the log :(
I have to execute a command manually:

sudo docker exec -it __ID__ php /var/www/html/install-dev/index_cli.php --domain="prestashop.local" --db_server=mysql:3306 --db_name="ps17" --db_user=docker --db_password=docker --prefix="ps_" --firstname="John" --lastname="Doe" [email protected] --email="[email protected]" --language=es --country=gb --newsletter=0 --send_email=0

My compouse file:

mariadb-ps17:
  image: mariadb
  ports:
    - 3306:3306
  env_file:
   - .env
ps_17:
  image: prestashop/prestashop:1.7-7.0
  links:
    - mariadb-ps17:mysql
  volumes:
   - ./www/themes:/var/www/html/themes
   - ./www/modules:/var/www/html/modules
   - ./www/override:/var/www/html/override
   - ./server_logs:/var/log
   - ./server_logs/php-fpm:/var/log/php-fpm
  ports:
   - "80:80"
  env_file:
   - .env

.env file

MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=ps17
MYSQL_USER=docker
MYSQL_PASSWORD=docker
DB_SERVER=mysql
DB_NAME=ps17
DB_USER=docker
DB_PASSWD=docker
DB_PREFIX=ps_
PS_LANGUAGE=es
PS_COUNTRY=gb
PS_DEV_MODE=1
PS_FOLDER_ADMIN=admin-dev
PS_FOLDER_INSTALL=install-dev
PS_INSTALL_AUTO=1
PS_DOMAIN=prestashop.local
PS_HANDLE_DYNAMIC_DOMAIN=0
[email protected]
[email protected]

Log:

https://gist.github.com/anonymous/f49884159b25c85a92503c600828a6d2

install-dev & admin-dev

Hi,

I would like to know if it the default behaviour for the folder to be named install-dev & admin-dev

Thank you!

How to don't install PS every time when container is restarting?

Hello,
With PS_INSTALL_AUTO=1 option installation runs everytime when I restart docker container. Is it expected behavior?
I think it's not convinient because of some reasons:

  • installation takes a time;
  • database lose all of the changes;

Is there any options to install Prestashop only once during creating of a container?

too much redirections & URL error

Hi,

I've got an nginx web server which redirects flow to your docker image (by a proxy_pass), bind by 8080:80 and which contains an apache server.

From default, all href on prestashop are redirecting to localhost:8080, so in the URL parameter i set my server ip (which goes to nginx) and i got an too much redirections error.

When i join my server via his ip on my browser, it works, but href goes to something like localhost:8080/path and to see the real page i have to replace localhost:8080 by my ip, don't where to set the modification.

When i define the real domain on ps admin interface, i've got an redirection's loop and fail (stopped by browser).

Any idea?

Alex :).

Session mix up behind proxy

When using a nginx Load balancer, user sessions get mess up.

I get with Tools:GetRemoteAddr(), the ip from the user, but the session dont work

Can't access prestashop on bridge network

Hello,

I've setup prestashop in a docker container. Here is my compose file :

version: '3'
services:
  myproject-mysql:
    image: mysql:$mysql_version
    container_name: myproject-mysql
    ports:
     - 3306:3306
    environment:
      - MYSQL_USER=myproject
      - MYSQL_PASSWORD=admin
      - MYSQL_ROOT_PASSWORD=admin
      - MYSQL_DATABASE=prestashop

  myproject-prestashop:
    image: prestashop/prestashop:$ps_version
    depends_on:
      - myproject-mysql
    container_name: myproject-prestashop
    working_dir: /var/www/html
    ports:
      - 8080:80
    links:
      - myproject-mysql
    volumes:
      - "./prestashopmyproject:/var/www/html/modules/prestashopmyproject"
    environment:
     - DB_SERVER=myproject-mysql
     - DB_NAME=prestashop
     - DB_USER=myproject
     - DB_PASSWD=admin
     - PS_INSTALL_AUTO=1
     - PS_DEV_MODE=1
     - PS_ERASE_DB=1
     - PS_FOLDER_ADMIN=admin-myproject
     - PS_DOMAIN=localhost:8080
     - PS_SHOP_URL=localhost:8080
     - PS_LANGUAGE=fr
     - PS_COUNTRY=fr
     - [email protected]
     - ADMIN_PASSWD=password
     - PS_FOLDER_INSTALL=install-myproject

I've setup a second docker compose which run a node project. This project need to access the prestashop api @ myproject-prestashop/api. Here is the configuration file :

version: '3'
services:
  myproject-webapp-builder:
    image: node:carbon
    user: "root"
    container_name: myproject-webapp-builder
    network_mode: "host"
    working_dir: /home/node/app
    ports:
      - 3335:3335
    volumes:
      - ./:/home/node/app
    command: "npm run docker"

When i access the prestashop from the host on localhost:8080, everything works as intented. I need to keep the prestashop exposed to the host. But on the node app, I can't access it.

Here is my network :

[
    {
        "Name": "myproject_default",
        "Id": "363af0901a281d5c89c2bf9895e56e89e19cad188681adfa667a7a192bd8db68",
        "Created": "2018-02-21T08:14:30.27854204Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "3a0b95e15906ee3eb12f11e05cb7318f4ccd334e01a4dfda5511ca786a2cd4ac": {
                "Name": "myproject-prestashop",
                "EndpointID": "5c7f4ec0d525a6cabd23ba7c2d8fe4a4d887fad25b7dd7d24ca75f688d1a26f5",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            },
            "421256a54ee0ea0da0c9cc0f46221aee7818f22d00943dde8ffd66af7a39e4aa": {
                "Name": "myproject-mysql",
                "EndpointID": "b49717e3c0f280967fb2de0dc5edfea29bbef72d8ea21e37f5f119b3b2c36213",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            },
            "4ee865aff1f7ce546225676e5c8a3be6df3a87f7446958723a53aff6aac44900": {
                "Name": "myproject-webapp-builder",
                "EndpointID": "ebe27e16dda2dff66577522cd9673bbea4f93b916abee1026b28f392d9d72c67",
                "MacAddress": "02:42:ac:12:00:04",
                "IPv4Address": "172.18.0.4/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "myproject"
        }
    }
]

If i connect to the node docker whis docker exec -ti myproject-webapp-builder bash, i can see the prestashop container :

root@4ee865aff1f7:/home/node/app# ping myproject-prestashop
PING myproject-prestashop (172.18.0.3): 56 data bytes
64 bytes from 172.18.0.3: icmp_seq=0 ttl=64 time=0.358 ms

But i cannot curl it :

root@4ee865aff1f7:/home/node/app# curl myproject-prestashop:8080 -I
curl: (7) Failed to connect to myproject-prestashop port 8080: Connection refused

root@4ee865aff1f7:/home/node/app# curl myproject-prestashop -I     
HTTP/1.0 302 Found
Date: Wed, 21 Feb 2018 08:57:19 GMT
Server: Apache/2.4.10 (Debian)
Location: http://localhost:8080/index.php?
Connection: close
Content-Type: text/html; charset=utf-8

I've seen the env variable PS_HANDLE_DYNAMIC_DOMAIN, and my guess is that there is something related to it, but I don't understand how to use it.

Thanks for the help

error in docker_run.sh with tag latest

Starting the contairner with this env vars :

      PS_DEV_MODE: 'true'
      PS_INSTALL_AUTO: 1
      PS_LANGUAGE: fr
      PS_COUNTRY: fr
      ADMIN_MAIL: [email protected]
      ADMIN_PASSWD: azerty
      PS_HANDLE_DYNAMIC_DOMAIN: 1

I get this error /tmp/docker_run.sh: 28: [: Illegal number: true

Prestashop in kubernetes

Hi friends, I use your image of docker for deploy one prestashop with mysql.

- name: DB_USER
  value: root
 - name: DB_PASSWD
  value: pass
- name: PS_DEV_MODE
  value: "1"
- name: DB_SERVER
  value: 10.254.210.20

The application not reply to the browser, I think that redirection does not work. I enter with node port.

Minion --->http://192.168.33.22:32444/install/

Log of the pod

W1222 16:21:01.378497   19535 cmd.go:161] log is DEPRECATED and will be removed in a future version. Use logs instead.

* Waiting for confirmation of MySQL service startup

* Waiting for confirmation of MySQL service startup

* Reapplying PrestaShop files for enabled volumes ...

* Enabling DEV mode ...

* Almost ! Starting Apache now

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.16.10.9. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.16.10.9. Set the 'ServerName' directive globally to suppress this message
[Thu Dec 22 16:10:36.534432 2016] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Thu Dec 22 16:10:36.534530 2016] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
172.16.10.1 - - [22/Dec/2016:16:10:37 +0000] "GET / HTTP/1.1" 302 226 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"
172.16.10.1 - - [22/Dec/2016:16:10:38 +0000] "GET /install/ HTTP/1.1" 302 445 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"
172.16.10.1 - - [22/Dec/2016:16:11:19 +0000] "GET /install/index.php?step=welcome HTTP/1.1" 302 376 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"
172.16.10.1 - - [22/Dec/2016:16:12:00 +0000] "GET /install/index.php?step=welcome HTTP/1.1" 302 376 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"
172.16.10.1 - - [22/Dec/2016:16:12:41 +0000] "GET /install/index.php?step=welcome HTTP/1.1" 302 376 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"

Thx friends

Package 'php-apc' has no installation candidate

Hello,

In recent days we have encountered a construction problem on our CI.
The image no longer builds and we have:

The package 'php-apc' does not have an installation candidate

Do you have an idea where this may come from?

Thanks

Enable SSL when autoinstalling

It would be useful to add another option to the container to enable SSL during auto installation (with PS_INSTALL_AUTO=1)

Where are the images stored?

Are the product images stored inside the container? It is possible to use S3 as file system -at least for the images-?

Volumes issue with short tags

Hi,

we have an issue with the dir / volumes with this new kind of image :

"Previously in PrestaShop/Docker" :

  • Prestashop dosen't manage well the symlinks (modules issues) > @toutantic
  • @Quetzacoalt91 > Docker Volumes Management cause issue with full dir (/var/www/html/ into a volume)

We will have an issue in this case too if the user pull the "head version" of image. The volume is persistent if the user don't use the -v on update.

Ex :
docker pull prestashop:1.6
... running container 1.6 and a new version of 1.6 image is release ...
docker pull prestashop:1.6
... docker stop / docker rm container ...
docker run container 1.6 < still old volume with old 1.6 prestashop :(

and if the user want to remove the volume, he loose everything (images, data, themes, module)

Conclusion : remove the short/head tags (1.6 / 1.7) > each build is a specific tag ? I have no other idea :(

can't reach mysql container from prestashop container

hi,

i ran
docker run -p 3306:3306 --name mysql -v ~/datadir/:/var/lib/mysql/ -e MYSQL_ROOT_PASSWORD=superpass -d mysql:latest
and
docker run -ti --name prestashop -p 8080:80 -d prestashop/prestashop

then in the prestashop installation wizard i can't reach the database, how can i create the link between these two containers?

Alex :)

Installing with the variable PS_INSTALL_AUTO=1 will not start the container automatically

We came up with the idea, to run a long command and set everything up precisely at once without spending time with configuration over and over again, but

sudo docker run -ti --name prestashop_test -p 8080:80 -d -e PS_INSTALL_AUTO=1 -e PS_FOLDER_ADMIN=admin_test -e PS_FOLDER_INSTALL=install_test prestashop/prestashop

will fail to start automatically.

If I remove the -e PS_INSTALL_AUTO=1 it works fine, but I have to feed all the input manually, which bugs me a bit.

Do you have any solution to this issue?

Thanks in advance!

Database dropped even with PS_ERASE_DB=0

Hi,

Database is still dropped even if I use PS_ERASE_DB=0 (with the PS_INSTALL_AUTO=1)
Is it normal ? I use external database

logs :

  • Reapplying PrestaShop files for enabled volumes ...

  • Renaming admin folder as admintest ...

  • Installing PrestaShop, this may take a while ...
    Database "prestashop" dropped

Thank you !

CLI installer not respecting arguments given

root@0088c07878be:/var/www/html/install# php index_cli.php --db_server=mysql-server --db_user=1 --db_password=something

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user 'prestashop'@'172.18.0.3' (using password: YES)

root@0088c07878be:/var/www/html/install# php index_cli.php --db_server=mysql-server --db_user=2 --db_password=something

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user '1'@'172.18.0.3' (using password: YES)

root@0088c07878be:/var/www/html/install# php index_cli.php --db_server=mysql-server --db_user=3 --db_password=something

Link to database cannot be established: SQLSTATE[HY000] [1045] Access denied for user '2'@'172.18.0.3' (using password: YES)

Notice how the use lags one output. Also 172.18.0.3 is localhost and not mysql-server:

root@0088c07878be:/var/www/html/install# ping mysql-server
PING mysql-server (172.18.0.2): 56 data bytes
64 bytes from 172.18.0.2: icmp_seq=0 ttl=64 time=0.292 ms

no link option for existing db container

Forgive me if I am mistaken because I am new to docker applications.
I see that you provide an option for an external db through a network IP ( using the e vars ) but would it be better to provide a --link option so that one could link it with an existing db that does not have a network interface?

Prestashop installation fails with Oops message

When having a look at the log, I see this:

10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
172.17.0.1 - - [16/Jun/2016:16:02:14 +0000] "GET /install/index.php?compile_templates=1&bo=0 HTTP/1.1" 500 185 "http://shop.p.com/install/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36"
[Thu Jun 16 16:02:14.024989 2016] [:error] [pid 554] [client 172.17.0.1:46909] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(/var/www/html/themes/default-bootstrap/): failed to open dir: No such file or directory' in /var/www/html/tools/smarty/sysplugins/smarty_internal_utility.php:68\nStack trace:\n#0 /var/www/html/tools/smarty/sysplugins/smarty_internal_utility.php(68): RecursiveDirectoryIterator->__construct('/var/www/html/t...')\n#1 /var/www/html/tools/smarty/Smarty.class.php(1440): Smarty_Internal_Utility::compileAllTemplates('.tpl', false, 0, NULL, Object(SmartyCustom))\n#2 /var/www/html/install/controllers/http/smarty_compile.php(42): Smarty->compileAllTemplates('.tpl', false)\n#3 /var/www/html/install/classes/controllerHttp.php(96): require_once('/var/www/html/i...')\n#4 /var/www/html/install/index.php(31): InstallControllerHttp::execute()\n#5 {main}\n  thrown in /var/www/html/tools/smarty/sysplugins/smarty_internal_utility.php on line 68,

Recursive write permissions missing

Hi,

first of all let me thank for this awesome Docker. It's always great to see an official software supporting new stack of tecnologies.

Although, using your Docker and binding volumes ( the one listed inside your Dockerfile ) during the installation this is returned:

prestashop

Can you consider moving this line outside that IF clause? Would really gives the user the possibility to do the installation also by hand :)

Thank you in advance,
Julian


CLI used:

docker run \
    -d \
    --restart=always \
    -e "ADMIN_MAIL=$ADMIN_MAIL" \
    -e "ADMIN_PASSWD=$ADMIN_PASSWD" \
    -v "/srv/modules:/var/www/html/modules" \
    -v "/srv/themes:/var/www/html/themes" \
    -v "/srv/override:/var/www/html/override" \
    prestashop/prestashop:1.6 &>/dev/null

First docker run

Hi,

I do not understand why it is also the first long run, is that you download all the versions?

Thank's

Adding modules/themes prior installation

Hi,

I'm trying to achieve fully automatic installation of the shop including custom modules and their configuration (and a theme possibly in the nearest future) of my choice. What I've tried already is to mount the volume having my unpacked modules both straight to the:

  • /var/html/www/modules folder, but of course it won't work just with a module folder copy as it's install script presumably puts some stuff to the database and so on
  • /var/html/modules, to let the PS image reapply the files from the volume. This works fine, but my module is only discoverable locally by PS (when putting its name in module search) but yet to be installed by manually clicking 'Install'. As the title states, I would like to have it already installed, up and ready at this stage.

Is there any way to achieve it? Where should I have a deeper look into? Maybe adding my module to the default set of modules installed by default?

Thanks for the great work though!

Empty ps_employee after auto_install

I'm trying to create a PS container in a local server, but after the installation I can't log in. Directly querying the DB (in a separate container) shows the employee table empty. This happens whenever I inform ADMIN_MAIL/_PASSWRD or not. Although some tables have contents like language, almost all the DB is empty.

My docker command is:
docker run --name test-prestashop --link mysql -e DB_SERVER=mysql -e DB_USER=root -e DB_PASSWD=admin -e DB_NAME=test-prestashop -e PS_INSTALL_AUTO=1 -e PS_ERASE_DB=1 -e PS_FOLDER_ADMIN=admin_test -e PS_FOLDER_INSTALL=install_test -p 8881:80 -e PS_DOMAIN=192.168.1.1:8881 -d prestashop/prestashop

192.168.1.1 is a docker server in my local network, and I'm browsing it from 192.168.1.1. I had to put that PS_DOMAIN so I could access it in my private network. If there's something better for it, please tell me.

Apache doesn't start if PS_INSTALL_AUTO=1

Hello,
I have a problem with starting apache if the PS_INSTALL_AUTO option is set on. It looks like infinite loading of the page http://172.18.0.3:8080/.

Everything is ok when I install PS manually.

OS: macOS Hight Sierra 10.13
Docker: 17.09.0-ce-mac35 (19611)

My docker-compose:

version: '3'
services:
  ps_mysql:
    image: mysql:latest
    container_name: ps_mysql
    restart: unless-stopped
    environment:
      - MYSQL_USER=ps_user
      - MYSQL_PASSWORD=ps_password
      - MYSQL_ROOT_PASSWORD=root

  ps_1724:
    image: prestashop/prestashop:1.7.2.4
    container_name: ps_1724
    restart: unless-stopped
    working_dir: /var/www/html
    ports:
      - 8080:80
    links:
      - ps_mysql
    environment:
      - DB_SERVER=ps_mysql
      - DB_NAME=ps_1724
      - DB_USER=ps_user
      - DB_PASSWD=ps_password
      - PS_INSTALL_AUTO=1
      - PS_ERASE_DB=1
      - PS_FOLDER_ADMIN=admin0
      - PS_FOLDER_INSTALL=install0
      - PS_LANGUAGE=en
      - PS_COUNTRY=uk
      - PS_DEV_MODE=true
      - PS_HANDLE_DYNAMIC_DOMAIN=1
      - [email protected]
      - ADMIN_PASSWD=prestashop_demo

Log (here is only prestashop container part):

$ docker-compose up
Creating network "pst_default" with the default driver
Creating ps_mysql ... 
Creating ps_mysql ... done
Creating ps_1724 ... 
Creating ps_1724 ... done
Attaching to ps_mysql, ps_1724
pst-mysql   | Initializing database
ps_1724     | 
ps_1724     | * Reapplying PrestaShop files for enabled volumes ...
ps_1724     | /tmp/docker_run.sh: 15: [: Illegal number: true
ps_1724     | 
ps_1724     | * Renaming install folder as install0 ...
ps_1724     | 
ps_1724     | * Renaming admin folder as admin0 ...
pst-mysql   | 2017-12-04T11:01:33.282350Z 0 [Note] End of list of non-natively partitioned tables
ps_1724     | 
ps_1724     | * Waiting for confirmation of MySQL service startup
ps_1724     | 
ps_1724     | * Installing PrestaShop, this may take a while ...
ps_1724     | 
ps_1724     | * Drop & recreate mysql database...
ps_1724     | 
ps_1724     | * Almost ! Starting Apache now
ps_1724     | 
ps_1724     | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
ps_1724     | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
ps_1724     | [Mon Dec 04 11:02:04.643578 2017] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
ps_1724     | [Mon Dec 04 11:02:04.643694 2017] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

Will appreciate for any help.

Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}

When I tried to run the Prestashop Docker (1.6 and latest version, I didn't test the others), the container is stopped with these errors:
```
[Fri Jul 08 14:29:29.956300 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Fri Jul 08 14:29:29.956377 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Fri Jul 08 14:29:29.956398 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Fri Jul 08 14:29:29.956411 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Fri Jul 08 14:29:29.956433 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jul 08 14:29:30.000715 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jul 08 14:29:30.001172 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Fri Jul 08 14:29:30.001197 2016] [core:warn] [pid 1] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:$


Can you check this because if I ran a php:5-apache container, it works well ?

Trying to pull image 1.6.11 fails

Whenever I try to pull the image 1.6.11 I get this error:

1.6.1.11: Pulling from prestashop/prestashop
693502eb7dfb: Pulling fs layer
16328c296404: Pulling fs layer
693502eb7dfb: Retrying in 11 seconds
5e1d4f4f29eb: Download complete
530750fc5019: Download complete
39e9c6c72db7: Download complete
de476ce7ac87: Download complete
4ad13cbbc7d8: Download complete
74c28aa07dc7: Download complete
a07a242e36fb: Download complete
3d491d166e88: Download complete
cb6c232330f0: Downloading
25a48aec9dc7: Waiting
e4cb61583b37: Downloading
2ca5e4dcfa24: Waiting
e14a55c546c4: Waiting
9148df828f4a: Waiting
d5ac6483af22: Waiting
bcaa6b72ca6b: Waiting
909dff057fd2: Waiting
d196c861cebe: Waiting
f10a9b54385f: Waiting
cf6d30544bcd: Waiting
8913498ea767: Waiting
c4a82f12f42b: Waiting
ERROR: unauthorized: authentication required

What could be going wrong here? I'm using this docker version:

Version 17.03.0-ce-mac2 (15654)
Channel: stable
1d7d97bbbd

image/1.5.6.2

Hi,

A lot of merchant use Prestashop 1.5.6.2. I test this image with docker and we have a problem about write permission in the function PHP mkdir for smarty.

Johan

Can not start the app

Hello,
I have followed the instruction in REAMME.md but I can not get the app to start in localhost:8080

docker run -ti --name some-mysql -e MYSQL_ROOT_PASSWORD=admin -d mysql
docker run -ti --name some-prestashop --link some-mysql -e DB_SERVER=some-mysql -p 8080:80 prestashop/prestashop

The console.log is

* Reapplying PrestaShop files for enabled volumes ...

* Almost ! Starting Apache now

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.3. Set the 'ServerName' directive globally to suppress this message
[Mon Jan 15 04:41:40.360249 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) configured -- resuming normal operations
[Mon Jan 15 04:41:40.362850 2018] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'

But it just stops there and nothing shows in localhost:8080

Add mail support

Is there a reason for not adding in the Dockerfile the installation of:

apt-get install -y ssmtp

so the PHP mail() function of PrestaShop can be called without failing?

Or is it failing just on my side?

Remove /install and rename /admin when PS_INSTALL_AUTO=1

When attempting to access the PrestaShop back-office following a successful automatic installation, you are faced with the following error:

For security reasons, you cannot connect to the back office until you have:
deleted the /install folder
renamed the /admin folder (e.g. admin3250jyr2e/)
Please then access this page by the new URL (e.g. http://172.19.0.3/admin3250jyr2e/)

It would be nice if the automatic installation script would take care of this. Perhaps the name that the /admin folder should be renamed to could also be passed in through a variable?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.