tracksolid_timescale_grafan.../backup/Dockerfile
David Kiania 108c1be057
Some checks failed
Static Analysis / static (push) Waiting to run
Tests / test (push) Waiting to run
Static Analysis / static (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
feat: nightly pg_dump sidecar uploads to rustfs fleet-db bucket
Adds a `db_backup` sidecar that dumps tracksolid_db every night at
02:30 UTC (configurable via BACKUP_HOUR/BACKUP_MINUTE), gzips the
output, and uploads to s3://fleet-db/daily/<dbname>_<ts>.sql.gz on
the rustfs S3-compatible instance (s3.rahamafresh.com). Prunes
objects older than BACKUP_KEEP_DAYS (default 30).

Required .env additions (Coolify UI):
  RUSTFS_ENDPOINT=https://s3.rahamafresh.com
  RUSTFS_ACCESS_KEY=...
  RUSTFS_SECRET_KEY=...
  RUSTFS_BUCKET=fleet-db

Mitigates data loss when Coolify service recreation wipes the
service-ID-scoped timescale-data volume.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 12:53:23 +03:00

16 lines
317 B
Docker

FROM alpine:3.20
RUN apk add --no-cache \
postgresql16-client \
aws-cli \
gzip \
tzdata \
bash \
coreutils
WORKDIR /app
COPY backup_db.sh /app/backup_db.sh
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/backup_db.sh /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]