shyim / shopware-docker

Easy to use Docker Installation for Shopware 5 and Shopware 6
MIT License
115 stars 27 forks source link

Different MySQL image for specific projects #77

Closed zaifastafa closed 3 years ago

zaifastafa commented 3 years ago

Is it possible to have mysql:8 for sw6 project and mysql:5.7 for sw5 in the same .env file? Similar to VHOST but for mysql.

shyim commented 3 years ago

I guess the best would be to have custom services and volumes :thinking:

shyim commented 3 years ago

I have adjust it to allow extending existing docker-compose

For MySQL 8

Create $HOME/.config/swdc/services.yml with content

version: '3.9'
services:
  mysql8:
    image: mysql:8
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - mysql8-data:/var/lib/mysql
    command: ["mysqld", "--default-authentication-plugin=mysql_native_password"]
volumes:
  mysql8-data:
zaifastafa commented 3 years ago

Awesome! So how will we bind to to a specific project ? For e.g I want to use mysql 8 for just one specific folder.

shyim commented 3 years ago
swdc build shopware --mysql-host mysql8

Works for any shopware version

zaifastafa commented 3 years ago

@shyim with reference to this - it works fine, but then the database / tables of this instance does not show up in the adminer as it takes the mysql version which is defined in the .env file and not the special one which we have defined.

shyim commented 3 years ago

You need to login in adminer with host mysql8