2 Commits

4 changed files with 24 additions and 10 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.idea
.env
var/*

View File

@@ -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 && \

View File

@@ -1,6 +1,9 @@
services:
sqlite_backup:
image: git.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:

View File

@@ -1,8 +1,17 @@
#!/bin/sh
# Create crontab in a writable location
# Create crontab in a writable location and set proper permissions
mkdir -p /tmp/crontabs
echo "${CRONTAB} /scripts/backup.sh" > /tmp/crontabs/root
echo "${CRONTAB:-"0 * * * *"} /scripts/backup.sh >> /proc/1/fd/1 2>&1" > /tmp/crontabs/root
chmod 644 /tmp/crontabs/root
/scripts/backup.sh
exec crond -f -c /tmp/crontabs
# Run initial backup
# /scripts/backup.sh
# Start crond with debug output
echo "Starting crond with config:"
cat /tmp/crontabs/root
echo "---"
# Start crond in foreground with debug output
exec crond -f -c /tmp/crontabs -d 8