mirror of https://github.com/docusealco/docuseal
Add Litestream->R2 replication + start.sh + Dockerfile for AWS Fargate (#1)
parent
ca9e6cedbf
commit
24816341db
@ -0,0 +1,13 @@
|
||||
# Litestream: replicate docuseal's SQLite db to R2 (same creds/bucket as attachments).
|
||||
dbs:
|
||||
- path: /data/docuseal/db.sqlite3
|
||||
replicas:
|
||||
- type: s3
|
||||
bucket: ${S3_ATTACHMENTS_BUCKET}
|
||||
path: litestream/docuseal
|
||||
endpoint: ${S3_ENDPOINT}
|
||||
region: auto
|
||||
access-key-id: ${AWS_ACCESS_KEY_ID}
|
||||
secret-access-key: ${AWS_SECRET_ACCESS_KEY}
|
||||
sync-interval: 60s
|
||||
retention: 168h
|
||||
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
DB=/data/docuseal/db.sqlite3
|
||||
mkdir -p /data/docuseal
|
||||
if [ ! -f "$DB" ]; then
|
||||
echo "[start.sh] DB missing — restoring from R2 via litestream..."
|
||||
litestream restore -if-replica-exists -config /etc/litestream.yml "$DB" || echo "[start.sh] WARN: restore failed; starting empty."
|
||||
fi
|
||||
exec litestream replicate -config /etc/litestream.yml -exec "/app/bin/bundle exec puma -C /app/config/puma.rb --dir /app"
|
||||
Loading…
Reference in new issue