diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b1d1ada..17fd1f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ ### Application Level Image CI ### Dave Conroy -name: 'Build Images' +name: 'build' on: push: diff --git a/README.md b/README.md index 3f74815..32cc079 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ -# hub.docker.com/r/tiredofit/db-backup +# github.com/tiredofit/docker-db-backup -[![Docker Pulls](https://img.shields.io/docker/pulls/tiredofit/db-backup.svg)](https://hub.docker.com/r/tiredofit/db-backup) -[![Docker Stars](https://img.shields.io/docker/stars/tiredofit/db-backup.svg)](https://hub.docker.com/r/tiredofit/db-backup) -[![Docker Layers](https://images.microbadger.com/badges/image/tiredofit/db-backup.svg)](https://microbadger.com/images/tiredofit/db-backup) +[![GitHub release](https://img.shields.io/github/v/tag/tiredofit/docker-db-backup?style=flat-square)](https://github.com/tiredofit/docker-db-backup/releases/latest) +[![Build Status](https://img.shields.io/github/workflow/status/tiredofit/docker-db-backup/build?style=flat-square)](https://github.com/tiredofit/docker-db-backup/actions?query=workflow%3Abuild) +[![Docker Stars](https://img.shields.io/docker/stars/tiredofit/db-backup.svg?style=flat-square&logo=docker)](https://hub.docker.com/r/tiredofit/db-backup/) +[![Docker Pulls](https://img.shields.io/docker/pulls/tiredofit/db-backup.svg?style=flat-square&logo=docker)](https://hub.docker.com/r/tiredofit/db-backup/) +[![Become a sponsor](https://img.shields.io/badge/sponsor-tiredofit-181717.svg?logo=github&style=flat-square)](https://github.com/sponsors/tiredofit) +[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/tiredofit) -## Introduction +* * * +## About -This will build a container for backing up multiple type of DB Servers +This will build a container for backing up multiple types of DB Servers Currently backs up CouchDB, InfluxDB, MySQL, MongoDB, Postgres, Redis servers. @@ -21,42 +25,61 @@ Currently backs up CouchDB, InfluxDB, MySQL, MongoDB, Postgres, Redis servers. * select when to start the first dump, whether time of day or relative to container start time * Execute script after backup for monitoring/alerting purposes -* This Container uses a [customized Alpine Linux base](https://hub.docker.com/r/tiredofit/alpine) which includes [s6 overlay](https://github.com/just-containers/s6-overlay) enabled for PID 1 Init capabilities, [zabbix-agent](https://zabbix.org) for individual container monitoring, Cron also installed along with other tools (bash,curl, less, logrotate, nano, vim) for easier management. It also supports sending to external SMTP servers. - -[Changelog](CHANGELOG.md) - -## Authors +## Maintainer - [Dave Conroy](https://github.com/tiredofit) ## Table of Contents -- [Introduction](#introduction) -- [Authors](#authors) +- [About](#about) +- [Maintainer](#maintainer) - [Table of Contents](#table-of-contents) -- [Prerequisites](#prerequisites) +- [Prerequisites and Assumptions](#prerequisites-and-assumptions) - [Installation](#installation) - - [Quick Start](#quick-start) + - [Build from Source](#build-from-source) + - [Prebuilt Images](#prebuilt-images) - [Configuration](#configuration) - - [Data-Volumes](#data-volumes) + - [Quick Start](#quick-start) + - [Persistent Storage](#persistent-storage) - [Environment Variables](#environment-variables) + - [Base Images used](#base-images-used) + - [Backing Up to S3 Compatible Services](#backing-up-to-s3-compatible-services) - [Maintenance](#maintenance) - [Shell Access](#shell-access) - - [Custom Scripts](#custom-scripts) + - [Manual Backups](#manual-backups) + - [Custom Scripts](#custom-scripts) +- [Support](#support) + - [Usage](#usage) + - [Bugfixes](#bugfixes) + - [Feature Requests](#feature-requests) + - [Updates](#updates) +- [License](#license) -## Prerequisites +## Prerequisites and Assumptions You must have a working DB server or container available for this to work properly, it does not provide server functionality! ## Installation -Automated builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/db-backup) and is the recommended -method of installation. +### Build from Source +Clone this repository and build the image with `docker build -t (imagename) .` + +### Prebuilt Images +Builds of the image are available on [Docker Hub](https://hub.docker.com/r/tiredofit/backuppc) and is the recommended method of installation. ```bash -docker pull tiredofit/db-backup:latest +docker pull tiredofit/backuppc:(imagetag) ``` +The following image tags are available along with their taged release based on what's written in the [Changelog](CHANGELOG.md): + +| Container OS | Tag | +| ------------ | --------- | +| Alpine | `:latest` | + + +## Configuration + ### Quick Start * The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). See the examples folder for a working [docker-compose.yml](examples/docker-compose.yml) that can be modified for development or production use. @@ -65,10 +88,7 @@ docker pull tiredofit/db-backup:latest * Map [persistent storage](#data-volumes) for access to configuration and data files for backup. > **NOTE**: If you are using this with a docker-compose file along with a seperate SQL container, take care not to set the variables to backup immediately, more so have it delay execution for a minute, otherwise you will get a failed first backup. - -## Configuration - -### Data-Volumes +### Persistent Storage The following directories are used for configuration and can be mapped for persistent storage. @@ -76,10 +96,18 @@ The following directories are used for configuration and can be mapped for persi | ------------------------ | ---------------------------------------------------------------------------------- | | `/backup` | Backups | | `/assets/custom-scripts` | *Optional* Put custom scripts in this directory to execute after backup operations | - ### Environment Variables -Along with the Environment Variables from the [Base image](https://hub.docker.com/r/tiredofit/alpine), below is the complete list of available options that can be used to customize your installation. +#### Base Images used + +This image relies on an [Alpine Linux](https://hub.docker.com/r/tiredofit/alpine) base image that relies on an [init system](https://github.com/just-containers/s6-overlay) for added capabilities. Outgoing SMTP capabilities are handlded via `msmtp`. Individual container performance monitoring is performed by [zabbix-agent](https://zabbix.org). Additional tools include: `bash`,`curl`,`less`,`logrotate`, `nano`,`vim`. + +Be sure to view the following repositories to understand all the customizable options: + +| Image | Description | +| ------------------------------------------------------ | -------------------------------------- | +| [OS Base](https://github.com/tiredofit/docker-alpine/) | Customized Image based on Alpine Linux | + | Parameter | Description | | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -106,7 +134,7 @@ Along with the Environment Variables from the [Base image](https://hub.docker.co When using compression with MongoDB, only `GZ` compression is possible. -**Backing Up to S3 Compatible Services** +#### Backing Up to S3 Compatible Services If `BACKUP_LOCATION` = `S3` then the following options are used. @@ -120,19 +148,22 @@ If `BACKUP_LOCATION` = `S3` then the following options are used. | `S3_PROTOCOL` | Use either `http` or `https` to access service - Default `https` | | `S3_URI_STYLE` | Choose either `VIRTUALHOST` or `PATH` style - Default `VIRTUALHOST` | + ## Maintenance -Manual Backups can be performed by entering the container and typing `backup-now` ### Shell Access For debugging and maintenance purposes you may want access the containers shell. -```bash -docker exec -it (whatever your container name is e.g.) db-backup bash -``` +``bash +docker exec -it (whatever your container name is) bash +`` +### Manual Backups +Manual Backups can be performed by entering the container and typing `backup-now` -#### Custom Scripts + +### Custom Scripts If you want to execute a custom script at the end of backup, you can drop bash scripts with the extension of `.sh` in this directory. See the following example to utilize: @@ -159,3 +190,23 @@ Outputs the following on the console: `0 mysql Backup Completed on example-db for example on 2020-04-22 05:19:10. Filename: mysql_example_example-db_20200422-051910.sql.bz2 Size: 7795 bytes MD5: 952fbaafa30437494fdf3989a662cd40` If you wish to change the size value from bytes to megabytes set environment variable `SIZE_VALUE=megabytes` + +## Support + +These images were built to serve a specific need in a production environment and gradually have had more functionality added based on requests from the community. +### Usage +- The [Discussions board](../../discussions) is a great place for working with the community on tips and tricks of using this image. +- Consider [sponsoring me](https://github.com/sponsors/tiredofit) personalized support. +### Bugfixes +- Please, submit a [Bug Report](issues/new) if something isn't working as expected. I'll do my best to issue a fix in short order. + +### Feature Requests +- Feel free to submit a feature request, however there is no guarantee that it will be added, or at what timeline. +- Consider [sponsoring me](https://github.com/sponsors/tiredofit) regarding development of features. + +### Updates +- Best effort to track upstream changes, More priority if I am actively using the image in a production environment. +- Consider [sponsoring me](https://github.com/sponsors/tiredofit) for up to date releases. + +## License +MIT. See [LICENSE](LICENSE) for more details. \ No newline at end of file