Dockerized version of python-github-backup with extra automation. This container makes a backup daily and keeps up to defined number of backups.
- Generate github access token. Give it a
repo
scope with full access to repositories. - Get provided
docker-compose.yml
. If needed change the mapping forvolumes
andMAX_BACKUPS
number - Change TZ (see the list)
- Set
TOKEN
(in environment or directly indocker-compose.yml
) - Set
GITHUB_USER
(Github user accounts) and/orGITHUB_ORG
(Github Organizations; make sure the user token has access to the organization). If you have multiple users/organizations, you can list thme separating names by a comma. - Run
docker-compose up -d
to initiate daily backup
The underlying python-github-backup library has a lot of options to customize what is backed up from github.
We can customize this by using the BACKUP_OPTIONS
environment variable. By default, the container will backup everything and uses --private --all --gist
. That will backup the repositories, issues, pull requests, labels, etc.
If you wanted to customize this to only backup the repository code (including private repositories), you could define the following on your docker-compose.yml
file's environment:
BACKUP_OPTIONS=--private --repositories
- Clone this repo
- run
docker-compose build