commit 1ddb53fa97505cd509d9419dcd1c145d1a24a91b Author: Niklas Date: Mon Mar 29 22:28:09 2021 +0200 initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..c1d29f9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +kind: pipeline +name: default + + +steps: +- name: docker + image: plugins/docker + settings: + repo: docker.kapelle.org/backup + registry: docker.kapelle.org diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17d4aa6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +* +!.gitignore +!Dockerfile +!docker-compose.yml +!entrypoint.sh +!README.md +!.drone.yml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..131601c --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5174348 --- /dev/null +++ b/docker-compose.yml @@ -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 \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..86a0099 --- /dev/null +++ b/entrypoint.sh @@ -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"