Feat/add local volumes backup (#821)

* Add Backup Docker Volumes Locally

* Update naming
This commit is contained in:
Ismail D 2022-12-25 01:49:30 +01:00 committed by GitHub
parent f35d0af8e6
commit 0737bedb99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,51 @@
captainVersion: 4
services:
$$cap_appname:
image: offen/docker-volume-backup:$$cap_version
environment:
BACKUP_FILENAME: $$cap_backup_filename
BACKUP_ARCHIVE: /archive
BACKUP_CRON_EXPRESSION: $$cap_backup_cron_expression
BACKUP_RETENTION_DAYS: $$cap_backup_retention_days
volumes:
- $$cap_volume_to_backup:/backup/data
- $$cap_backup_path:/archive
restart: always
caproverExtra:
notExposeAsWebApp: 'true'
caproverOneClickApp:
variables:
- id: $$cap_version
label: Docker volume backup version
defaultValue: 'v2'
description: Check out their Docker page for the valid tags https://hub.docker.com/r/offen/docker-volume-backup/tags
validRegex: /^([^\s^\/])+$/
- id: $$cap_volume_to_backup
label: Volume to backup
description: Path of the volume that you want to backup, e.g. `/var/lib/docker/volumes/captain--my-app/_data`
- id: $$cap_backup_path
label: Backup path
defaultValue: '/backups'
description: Path where you want to store the backups
- id: $$cap_backup_filename
label: Backup filename
defaultValue: 'backup-%Y-%m-%dT%H-%M-%S.tar.gz'
description: The name of the backup file including the `.tar.gz` extension. Format verbs will be replaced as in `strftime`. Omitting them will result in the same filename for every backup run, which means previous versions will be overwritten on subsequent runs. The default results in filenames like `backup-2021-08-29T04-00-00.tar.gz`.
- id: $$cap_backup_cron_expression
label: Cron expression
defaultValue: '@daily'
description: Backups run on the given cron schedule in `busybox` flavor. If no value is set, `@daily` will be used. If you do not want the cron to ever run, use `0 0 5 31 2 ?`.
- id: $$cap_backup_retention_days
label: Backup retention days
defaultValue: '14'
description: Define this value to enable automatic rotation of old backups. The value declares the number of days for which a backup is kept.
instructions:
start: >-
Backup Docker volumes locally. See https://github.com/offen/docker-volume-backup.
end: >-
Aaaand you're done! 😄
Your service is up and running
displayName: Docker volume backup
isOfficial: true
description: Backup Docker volumes locally
documentation: Taken from https://github.com/offen/docker-volume-backup

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB