fradelg / docker-mysql-cron-backup

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

Change MYSQL_* to MARIADB_* #122

Open iuriguilherme opened 1 month ago

iuriguilherme commented 1 month 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 1 month 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}