From 592e61700543e2c2d48414b15bf3a62c84acf03b Mon Sep 17 00:00:00 2001 From: "Fco. Javier Delgado del Hoyo" Date: Sun, 28 Jul 2019 16:45:33 +0200 Subject: [PATCH] added docker-compose file for testing and bump base image --- Dockerfile | 2 +- docker-compose.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile index c0ba4d9..02961b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM alpine:3.10 LABEL maintainer "Fco. Javier Delgado del Hoyo " RUN apk add --update bash mysql-client gzip openssl && rm -rf /var/cache/apk/* diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..d0b693f --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,33 @@ +version: "2" +services: + mariadb: + image: mariadb:10 + container_name: my_mariadb + expose: + - 3306 + volumes: + - data:/var/lib/mysql + - ${VOLUME_PATH}/backup:/backup + environment: + - MYSQL_DATABASE=${DATABASE_NAME} + - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} + restart: unless-stopped + + backup: + build: . + image: fradelg/mysql-cron-backup + depends_on: + - mariadb + volumes: + - ${VOLUME_PATH}/backup:/backup + environment: + - MYSQL_HOST=my_mariadb + - MYSQL_USER=root + - MYSQL_PASS=${MARIADB_ROOT_PASSWORD} + - MAX_BACKUPS=1 + - INIT_BACKUP=1 + - CRON_TIME=0 0 * * * + restart: unless-stopped + +volumes: + data: \ No newline at end of file