dnhsoft / sw-docker-demo

Shopware Docker Demo Files
17 stars 10 forks source link

Waiting for mysql server... shopware:5.1.2 #3

Closed dciccale closed 7 years ago

dciccale commented 7 years ago

Hi, I am using this docker-compose.yml file

shop:
  image: dnhsoft/shopware:5.1.2
  links:
   - db
   - mailhog
  ports:
   - "8000:80"

db:
  image: dnhsoft/mysql-utf8:5.7
  volumes:
   - ".database:/var/lib/mysql"

pma:
  image: dnhsoft/phpmyadmin:4.6.3
  links:
   - db
  ports:
   - "8001:80"

mailhog:
  image: mailhog/mailhog
  expose:
   - "1025"
   - "8025"
  ports:
   - "8025:8025"

And then running this in order:

docker-compose up -d
docker-compose exec shop /swtools/init.sh
docker-compose exec shop /swtools/install-demo-data-en.sh

However, it gets stuck when running /swtools/init.sh with this message: "Waiting for mysql server..."

How could I solve this to run shopware v 5.1.2 with demo database?

Thank you in advance.

chudomir-delchev-dnh commented 7 years ago

Hi,

From some Shopware version we changed the default DB user from admin to root.

In this older Shopware version you need to explicitly indicate the database username.

Therefore just add an environment variable to the shop section:

shop:
  image: dnhsoft/shopware:5.1.2
  links:
   - db
   - mailhog
  ports:
   - "8000:80"
  environment:
   SWDB_USER: root
dciccale commented 7 years ago

solved. thanks