Sign inSign up

imousmoutis/mysql-dump

By imousmoutis

•Updated over 4 years ago

Image
0

164

imousmoutis/mysql-dump repository overview

⁠mysql-dump Image

This image is responsible for running the mysqldump command for one or multiple MySQL/MariaDB schemas.

The commands are set to run as a cron job every day at 03:00am and store the files under the path /db-dumps. Also, dump files older than 10 days are automatically deleted.

The files as being stored with the filename pattern: schema-dump-date.sql.

In order to use it the following env variables must be set:

  • DB_HOST: The hostname of the MySQL/MariaDB server,
  • DB_PORT: The port of the server.
  • DB_USER: The user of the server.
  • DB_PASS: The user password of the server.
  • DB_SCHEMAS: The comma-separated schemas.

An example of a Docker Compose configuration is the following:

mariadb-backup:
    image: imousmoutis/mysql-dump:0.0.5
    container_name: mariadb-backup-container
    environment:
      DB_HOST: mariadb-server
      DB_PORT: 3308
      DB_USER: root
      DB_PASS: 0b50fee2-9c88-46ac-82a9-e39b9ed07f70
      DB_SCHEMAS: schemaA,schemaB,schemaC
    restart: unless-stopped
    depends_on:
      - mariadb-server
    volumes:
      - '/usr/src/app/db-dumps:/db-dumps'
      - /etc/localtime:/etc/localtime

Tag summary

Content type

Image

Digest

Size

73.7 MB

Last updated

over 4 years ago

docker pull imousmoutis/mysql-dump:0.0.5