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>
16 lines
317 B
Docker
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"]
|