From 8145f459029897b7a3cb8e77b61686f9e7b0d1e1 Mon Sep 17 00:00:00 2001 From: rizlas Date: Fri, 21 Jun 2024 23:04:20 +0200 Subject: [PATCH] update alpine version. update go cron version and exec command, add tzdata, use postgres 16 --- docker-compose.yaml | 10 +++++----- src/install.sh | 8 ++++---- src/run.sh | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 16ac481..17cf9c6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,7 @@ services: postgres: - image: postgres:14 + image: postgres:16 environment: POSTGRES_USER: user POSTGRES_PASSWORD: password @@ -12,11 +12,11 @@ services: build: context: . args: - ALPINE_VERSION: '3.16' + ALPINE_VERSION: "3.20" environment: - SCHEDULE: '@weekly' # optional - BACKUP_KEEP_DAYS: 7 # optional - PASSPHRASE: passphrase # optional + SCHEDULE: "@weekly" # optional + BACKUP_KEEP_DAYS: 7 # optional + PASSPHRASE: passphrase # optional S3_REGION: S3_ACCESS_KEY_ID: S3_SECRET_ACCESS_KEY: diff --git a/src/install.sh b/src/install.sh index 5077ee2..f06c9ef 100644 --- a/src/install.sh +++ b/src/install.sh @@ -5,6 +5,9 @@ set -o pipefail apk update +# install tzdata +apk add --no-cache tzdata + # install pg_dump apk add postgresql-client @@ -15,10 +18,7 @@ apk add aws-cli # install go-cron apk add curl -curl -L https://github.com/ivoronin/go-cron/releases/download/v0.0.5/go-cron_0.0.5_linux_${TARGETARCH}.tar.gz -O -tar xvf go-cron_0.0.5_linux_${TARGETARCH}.tar.gz -rm go-cron_0.0.5_linux_${TARGETARCH}.tar.gz -mv go-cron /usr/local/bin/go-cron +curl --fail --retry 4 --retry-all-errors -L https://github.com/prodrigestivill/go-cron/releases/download/v0.0.10/go-cron-linux-$TARGETARCH-static.gz | zcat > /usr/local/bin/go-cron chmod u+x /usr/local/bin/go-cron apk del curl diff --git a/src/run.sh b/src/run.sh index 90b5fcb..74caaca 100644 --- a/src/run.sh +++ b/src/run.sh @@ -9,5 +9,5 @@ fi if [ -z "$SCHEDULE" ]; then sh backup.sh else - exec go-cron "$SCHEDULE" /bin/sh backup.sh + exec go-cron -s "$SCHEDULE" -p 0 -- /bin/sh backup.sh fi