dnhsoft / docker-shopware

Shopware ready to use as a Docker container
MIT License
28 stars 9 forks source link

mysql database not found when running init.sh #4

Closed thekie closed 5 years ago

thekie commented 5 years ago

Hello, I use this docker compose file:

shop:
  image: dnhsoft/shopware:5.5.4-php7
  links:
   - db
   - mailhog
  volumes:
   - "./../dev:/shopware/custom/plugins/dev"
  ports:
   - "8000:80"

db:
  image: tutum/mysql:5.6
  volumes:
   - ".database:/var/lib/mysql"
  environment:
   MYSQL_PASS: 123456

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

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

When I run your init.sh (I got this from example 6 "how to develop a plugin"), I see the following:

Waiting for mysql server...
Waiting for mysql server...
Waiting for mysql server...
Waiting for mysql server...
Waiting for mysql server...
Waiting for mysql server...

It works with dnhsoft/shopware:5.1.6 … What do I wrong?

NikolaIvanovski commented 5 years ago

In dnhsoft/shopware:5.1.6 mysql username is set to admin, in version 5.2.x is root but in tutum/mysql username is admin, so in docker-compose.yml file for shop just add the following

environment:
   SWDB_USER: admin 
thekie commented 5 years ago

Thank you that worked. Maybe you should put that somewhere in the README.md

This message when the mysql db is starting up is rather misleading:

db_1       | You can now connect to this MySQL Server using:
db_1       | 
db_1       |     mysql -uadmin -p123456 -h<host> -P<port>
db_1       | 
db_1       | Please remember to change the above password as soon as possible!
db_1       | MySQL user 'root' has no password but only allows local connections

Thanks very much for your help!