initial commit

This commit is contained in:
Niklas 2021-03-29 22:28:09 +02:00
commit 1ddb53fa97
6 changed files with 51 additions and 0 deletions

10
.drone.yml Normal file
View File

@ -0,0 +1,10 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
repo: docker.kapelle.org/backup
registry: docker.kapelle.org

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*
!.gitignore
!Dockerfile
!docker-compose.yml
!entrypoint.sh
!README.md
!.drone.yml

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM alpine:latest
RUN apk add --no-cache mysql-client restic rclone
RUN mkdir /app && mkdir /config
COPY entrypoint.sh /app/entrypoint.sh
WORKDIR /config
VOLUME /config
ENTRYPOINT /app/entrypoint.sh

0
README.md Normal file
View File

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: "3"
services:
backup:
build: .
environment:
- RCLONE_REMOTE=gdrive:/backup
- RCLONE_CONFIG=/config/rclone.conf
- RESTIC_PASSWORD=repopw
volumes:
- ./mounts:/backup
- ./config:/config

9
entrypoint.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
[ -z "${RCLONE_REMOTE}" ] && echo "\$RCLONE_REMOTE is not set" && exit 1
[ -z "${RCLONE_CONFIG}" ] && echo "\$RCLONE_CONFIG is not set" && exit 1
[ -z "${RESTIC_PASSWORD}" ] && echo "\$RESTIC_PASSWORD is not set" && exit 1
restic -r "rclone:$RCLONE_REMOTE" --verbose backup "/backup"