From 55f7d7f2e20887018579af48aede546b8e9f4359 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Fri, 12 Dec 2025 13:16:54 +0300 Subject: [PATCH] Try and setup litestream for S3 backups --- compose.yaml | 28 ++++++++++++++++++++++++++++ config/litestream.yaml | 10 ++++++++++ mise.toml | 1 + 3 files changed, 39 insertions(+) create mode 100644 config/litestream.yaml diff --git a/compose.yaml b/compose.yaml index 4a61fdbf..9d50e8b9 100644 --- a/compose.yaml +++ b/compose.yaml @@ -33,6 +33,34 @@ services: interval: 10s timeout: 20s retries: 10 + backup: + image: litestream/litestream + user: "0" + configs: + - source: litestream + target: /opt/litestream/litestream.yaml + volumes: + - /data/coolify/applications/music-library:/mnt/music_library + entrypoint: /usr/local/bin/litestream + command: replicate -config /opt/litestream/litestream.yaml + healthcheck: + disable: true + environment: + - LITESTREAM_ACCESS_KEY_ID + - LITESTREAM_SECRET_ACCESS_KEY +configs: + litestream: + content: | + dbs: + - path: /mnt/music_library/music_library_prod.db + replica: + type: s3 + name: music_library_prod + bucket: ffmusiclibrary + path: prod + endpoint: https://nbg1.your-objectstorage.com + sync-interval: 60m + retention: 672h secrets: FLUXON_KEY_FINGERPRINT: environment: FLUXON_KEY_FINGERPRINT diff --git a/config/litestream.yaml b/config/litestream.yaml new file mode 100644 index 00000000..0fe39b13 --- /dev/null +++ b/config/litestream.yaml @@ -0,0 +1,10 @@ +dbs: + - path: /mnt/music-library/music_library_prod.db + replica: + type: s3 + name: music_library_prod + bucket: ffmusiclibrary + path: prod + endpoint: https://nbg1.your-objectstorage.com + sync-interval: 1m + retention: 672h # 4 weeks diff --git a/mise.toml b/mise.toml index 52b6ddb4..fa5a14c1 100644 --- a/mise.toml +++ b/mise.toml @@ -23,6 +23,7 @@ sqlite = 'latest' gh = 'latest' shellcheck = 'latest' fd = 'latest' +litestream = 'latest' [task_config] includes = ["scripts"]