https://github.com/hadim/docker-github-backup
A Docker image that run github-backup periodically using cron and s6-overlay.
https://github.com/hadim/docker-github-backup
Last synced: 5 months ago
JSON representation
A Docker image that run github-backup periodically using cron and s6-overlay.
- Host: GitHub
- URL: https://github.com/hadim/docker-github-backup
- Owner: hadim
- License: mit
- Created: 2019-10-22T15:17:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-25T23:45:43.000Z (almost 6 years ago)
- Last Synced: 2025-03-15T14:01:44.841Z (about 1 year ago)
- Language: Dockerfile
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-github-backup
[](https://hub.docker.com/r/hadim/docker-github-backup 'DockerHub')
[](https://hub.docker.com/r/hadim/docker-github-backup 'DockerHub')
[](https://hub.docker.com/r/hadim/docker-github-backup 'DockerHub')
[](https://microbadger.com/images/hadim/docker-github-backup "MicroBadger")
A Docker image that run [`github-backup`](https://github.com/josegonzalez/python-github-backup) periodically using `cron` and [`s6-overlay`](https://github.com/just-containers/s6-overlay).
## How to use
### Docker Hub
Use the following `docker-compose.yml` file:
```yaml
version: '3'
services:
github-backup:
container_name: github-backup
image: hadim/docker-github-backup
restart: unless-stopped
volumes:
- ../github_backup:/data
environment:
TIMEZONE: "America/Montreal"
PUID: 1000
PGID: 1000
CRONTAB_OPTIONS: "0 0 * * *"
GITHUB_USER: $GITHUB_USER
GITHUB_TOKEN: $GITHUB_TOKEN
GITHUB_MAX_BACKUPS: 5
GITHUB_BACKUP_OPTIONS: "--private --gists --all"
```
### Cloning
You need to clone this repository and build the repository:
```bash
git clone https://github.com/hadim/docker-github-backup.git
cd docker-github-backup/
docker-compose build
```
Edit `docker-compose.yml`. Then run the container:
```bash
docker-compose up -d
docker-compose logs -f github-backup
```
## Configurations
### Data Volumes
| Directory | Description |
| --- | --- |
| `/data` | Backup Directory |
### Environment Variables
| Parameter | Function | Default |
| --- | --- | --- |
| `TIMEZONE` | [Timezone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | `"America/Montreal"` |
| `PUID` | User ID (use `id $USER`) | `1000` |
| `PGID` | Group ID (use `id $USER`) | `1000` |
| `CRONTAB_OPTIONS` | Crontab options | `"0 0 * * *"` |
| `GITHUB_USER` | GitHub username | `$GITHUB_USER` |
| `GITHUB_TOKEN` | [GitHub token](https://github.com/settings/tokens) | `$GITHUB_TOKEN` |
| `GITHUB_MAX_BACKUPS` | Older backups will be deleted | `5` |
| `GITHUB_BACKUP_OPTIONS` | [GitHub backup options](https://github.com/josegonzalez/python-github-backup#usage) | `"--private --gists --all"` |
## License
[MIT License](./LICENSE).
## Author
- [Hadrien Mary](https://github.com/hadim)