PrestaShop / docker

🐳
https://hub.docker.com/r/prestashop/prestashop/
MIT License
259 stars 177 forks source link

Auto Install PS_INSTALL_AUTO=1 with DB_SERVER='host.docker.internal' Not working #307

Closed rahadur closed 2 years ago

rahadur commented 2 years ago

For my store I want to connect MySQL database form my Host machine instead of docker container.

I have other service using this 'host.docker.internal' and working fine.

When I try PS_INSTALL_AUTO=1 it's not connect to my database, But when I manually setup prestashop and use 'host.docker.internal' as DB_SERVER it's working fine.

docker-compose.yml file

version: '3.9'

services:
  prestashop_1.7:
    image: prestashop/prestashop:1.7
    container_name: exampleshop
    ports:
      - 8060:80
    volumes:
      - ~/exampleshop/upload:/var/www/html/upload
      - ~/exampleshop/modules:/var/www/html/modules
      - ~/exampleshop/themes:/var/www/html/themes
      - ~/exampleshop/download:/var/www/html/download
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - nazakatshop
    environment:
      PS_INSTALL_AUTO: 1
      DB_SERVER: 'host.docker.internal'
      DB_NAME: 'exampleshop'
      DB_USER: 'root'
      DB_PASSWD: 'admin'
      PS_FOLDER_ADMIN: 'admin121298'
      PS_FOLDER_INSTALL: '.unknown'
      PS_COUNTRY: 'BD'
      ADMIN_EMAIL: 'example@email.com'
      ADMIN_PASSWORD: 'qwer1234'

networks:
  exampleshop:

Terminal

PS_INSTALL_AUTO=1 not connect to my database this log repeatedly showing

exampleshop       |
exampleshop       | * Checking if host.docker.internal is available...
exampleshop       |
exampleshop       | * Waiting for confirmation of MySQL service startup
exampleshop       |
exampleshop       | * Checking if host.docker.internal is available...
exampleshop       |
exampleshop       | * Waiting for confirmation of MySQL service startup
exampleshop       |
exampleshop       | * Checking if host.docker.internal is available...
exampleshop       |
exampleshop       | * Waiting for confirmation of MySQL service startup