A docker container to backup your Kubernetes-based Gitea instance to a S3 bucket or SFTP server.
Create a configuration file as described in the ten7.gitea_backup Ansible role.
Once created, you have three ways to provide it to the container:
- As a base64-encoded value of the
GITEA_BACKUP_CONFIGenvironment variable - As a mounted file at the location specified by the
GITEA_BACKUP_CONFIG_FILEenvironment variable - As a mounted file at
/config/gitea-backup/gitea-backup.ymlinside the container.
To run the Docker image as part of a script or in cron, use the following command:
docker run --rm -v /path/to/gitea-backup.yml:/config/gitea-backup/gitea-backup.yml ten7/gitea-backupNote, that if your gitea-backup.yml file depends on other files (such as TLS keys) you will need to add multiple -v switches to mount each one.
Create the following Docker Compose file.
version: '3'
services:
backup:
image: ten7/gitea-backup
volumes:
- /path/to/gitea-backup.yml:/config/gitea-backup/gitea-backup.ymlAgain, if your gitea-backup.yml depends on other files (such as TLS keys) you will need to add additional items under volumes to mount them.
Once the docker-compose.yml file is created, you can run backups using:
docker-compose run backupGPL v3
This Docker image was created by TEN7.