Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
49e777ece1
|
|||
4d2e79fef7
|
|||
63f6f969cc
|
|||
03fa82b223
|
|||
235b1a10d8
|
|||
1a01c67759
|
|||
a45b2cfc60
|
|||
2b47398f95
|
|||
f04c1ec1b9
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
.idea
|
||||
.env
|
||||
var/*
|
||||
|
11
Dockerfile
11
Dockerfile
@@ -1,17 +1,18 @@
|
||||
FROM alpine:latest
|
||||
FROM alpine:3.19
|
||||
|
||||
ENV TZ=UTC
|
||||
LABEL maintainer="Vassiliy Yegorov <vasyakrg@gmail.com>"
|
||||
|
||||
RUN apk add --no-cache \
|
||||
sqlite \
|
||||
curl \
|
||||
wget \
|
||||
bash \
|
||||
tzdata \
|
||||
openssl
|
||||
openssl \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
RUN curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip && \
|
||||
unzip rclone-current-linux-amd64.zip && \
|
||||
RUN wget https://github.com/rclone/rclone/releases/download/v1.71.0/rclone-v1.71.0-linux-amd64.zip && \
|
||||
unzip rclone-v1.71.0-linux-amd64.zip && \
|
||||
cd rclone-*-linux-amd64 && \
|
||||
cp rclone /usr/bin/ && \
|
||||
chown root:root /usr/bin/rclone && \
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
DOCKER_BASEIMAGE=alpine:latest
|
||||
TAG=$1
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t hub.realmanual.ru/pub/sqlite-backup \
|
||||
--build-arg DOCKER_BASEIMAGE=${DOCKER_BASEIMAGE} .
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG=latest
|
||||
fi
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 --push -t git.realmanual.ru/pub/sqlite-backup:${TAG} .
|
||||
|
@@ -1,6 +1,9 @@
|
||||
services:
|
||||
sqlite_backup:
|
||||
image: hub.realmanual.ru/pub/sqlite-backup/backup:latest
|
||||
# image: git.realmanual.ru/pub/sqlite-backup/backup:latest
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: sqlite_backup
|
||||
restart: always
|
||||
volumes:
|
||||
|
@@ -1,6 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "${CRONTAB} /scripts/backup.sh" > /etc/crontabs/root
|
||||
set +e
|
||||
|
||||
# Create crontab in a writable location and set proper permissions
|
||||
echo "${CRONTAB:-"0 * * * *"} /scripts/backup.sh >> /proc/1/fd/1 2>&1" > /etc/crontabs/root
|
||||
|
||||
# Run initial backup
|
||||
/scripts/backup.sh
|
||||
exec crond -f
|
||||
|
||||
# Start crond in foreground with debug output
|
||||
exec crond -f -d 0
|
||||
|
@@ -14,19 +14,20 @@ secret_access_key = $MINIO_APPLICATION_KEY
|
||||
endpoint = $MINIO_ENDPOINT
|
||||
region = $MINIO_LOCATION
|
||||
acl = private
|
||||
no_check_bucket = true
|
||||
EOF
|
||||
|
||||
case $1 in
|
||||
copy)
|
||||
echo "copy from $2 to $3"
|
||||
rclone copy --progress $2 myminio:$3
|
||||
rclone copy --progress $2 $3
|
||||
;;
|
||||
list)
|
||||
echo "list $2"
|
||||
rclone ls myminio:$2
|
||||
echo "list ${MINIO_PATH}/$2"
|
||||
rclone ls ${MINIO_PATH}/$2
|
||||
;;
|
||||
delete)
|
||||
echo "delete $2"
|
||||
rclone delete myminio:$2
|
||||
echo "delete ${MINIO_PATH}/$2"
|
||||
rclone delete ${MINIO_PATH}/$2
|
||||
;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user