wger-project / wger

Self hosted FLOSS fitness/workout, nutrition and weight tracker
https://wger.de
GNU Affero General Public License v3.0
3.19k stars 586 forks source link

MySQL/MariaDB support for docker image OOTB #926

Open MenchenFive opened 2 years ago

MenchenFive commented 2 years ago

Use case

I am currently attempting to install wger in my homeserver via docker. Because I have other services running, like gitea or nextcloud, I wanted to reuse the existing database container I had by setting up a db and user for wger to use. After doing so, I set up the environment variable DJANGO_DB_ENGINE to django.db.backends.mysql per django documentation, thinking it would work. But it didn't, since it seems that the mysql connector and its dependencies are missing from the wger image.

While it would be easy to spin up a postgre instance just for wger; some of the reasons of me not wanting to do that is performance (an extra database manager would be extra resources), and centralization: Docker makes it easy to spin up a db for each web service, but centralizing all services in just one dbms instance has its advantages too, like making maintenance easier since there is only one instance to dump for backups and take care of; though I do not want to turn this issue into a monolith vs microservices war.

I understand that you can't/shouldn't support every single DBMS out there, but mariadb is one of the major contestants along postgre (and sqlite) and allowing this choice would be more than welcome, I'm sure.

Proposal

Include mysqlclient and its neccessary dependencies in the docker image.

DorianHawkmoon commented 1 year ago

I agree with it. I'm trying to install it without the docker, so manually installed the library dependency, and I had to import the library in init.py but still doesn't seem to properly work. Do you have plans for improving myqsl support?