fradelg / docker-mysql-cron-backup

Docker image to backup all your databases periodically
Apache License 2.0
305 stars 111 forks source link

Change MYSQL_* to MARIADB_* #122

Open iuriguilherme opened 4 months ago

iuriguilherme commented 4 months ago

latest mariadb uses environment variables like MARIADB_USER MARIADB_PASSWORD MARIADB_DATABASE instead of the MYSQL prefix.

Docker compose doesn't override multiple env files when using the form MYSQL_USER: ${MARIADB_USER}

So I have to update the same value twice when sharing the env_file with the mariadb container:

MARIADB_USER: user
MYSQL_USER: user
fradelg commented 4 months ago

I think docker-compose support loading environment variables from a .env file and then use them in your docker-compose:

https://stackoverflow.com/questions/29377853/how-can-i-use-environment-variables-in-docker-compose

# .env file
MARIADB_USER: user
version: "2"
services:
  mariadb:
  ...
  environment:
    MARIADB_USER: ${MARIADB_USER}
...
  mysql-cron-backup:
  ...
  environment:
    MYSQL_USER: ${MARIADB_USER}