Skip to content

v1.0.0

Latest

Choose a tag to compare

@johnnybui johnnybui released this 06 Oct 08:06
· 2 commits to main since this release

Release v1.0.0 - Initial Stable Release 🎉

🚀 What's New

postgres-backup-s3 is an automated PostgreSQL backup solution supporting AWS S3, Cloudflare R2, and S3-compatible storage services.

🌟 Key Features

Multiple Database Support

Backup multiple databases in a single container:

environment:
  POSTGRES_DATABASE: "app_db,analytics_db,logs_db"
  PARALLEL_BACKUP: "yes"  # Optional: backup in parallel

Multi-Storage Support

# AWS S3
STORAGE_TYPE: S3
S3_REGION: us-west-1

# Cloudflare R2 (simplified config!)
STORAGE_TYPE: R2
R2_ACCOUNT_ID: your-account-id

# S3-Compatible (Minio, DigitalOcean Spaces, etc.)
STORAGE_TYPE: COMPATIBLE
S3_ENDPOINT: http://minio:9000

Flexible Backup Options

  • 🔐 AES-256-CBC encryption
  • ⏰ Cron scheduling (@daily, @hourly, or custom syntax)
  • 🗜️ PostgreSQL custom format with parallel restore
  • 🧹 Automatic cleanup of old backups
  • ⚡ Parallel compression with pigz

Easy Manual Trigger

# Instant manual backup
docker compose exec postgres-backup /backup.sh

# Override databases
docker exec postgres-backup -e POSTGRES_DATABASE="db1,db2" /backup.sh

Simple Restore

docker compose run --rm \
  -e BACKUP_FILE="postgres/db_2025-10-06.sql.gz" \
  -e POSTGRES_DATABASE="mydb" \
  postgres-backup

📦 Installation

Docker Compose (Recommended)

version: '3.8'
services:
  postgres-backup:
    image: ghcr.io/johnnybui/postgres-backup-s3:1.0.0
    environment:
      STORAGE_TYPE: R2
      R2_ACCOUNT_ID: ${R2_ACCOUNT_ID}
      S3_BUCKET: ${BACKUP_BUCKET}
      S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
      S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
      
      POSTGRES_HOST: postgres
      POSTGRES_DATABASE: "db1,db2,db3"
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      
      SCHEDULE: "@daily"
      ENCRYPTION_PASSWORD: ${BACKUP_ENCRYPTION_KEY}
      DELETE_OLDER_THAN: "30 days ago"

Docker Run

docker run -d \
  -e STORAGE_TYPE=R2 \
  -e R2_ACCOUNT_ID=your-account-id \
  -e S3_BUCKET=backups \
  -e S3_ACCESS_KEY_ID=your-key \
  -e S3_SECRET_ACCESS_KEY=your-secret \
  -e POSTGRES_HOST=postgres.example.com \
  -e POSTGRES_DATABASE=mydb \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=password \
  -e SCHEDULE="@daily" \
  ghcr.io/johnnybui/postgres-backup-s3:1.0.0

🎯 Quick Start

# 1. Download example files
curl -o docker-compose.yml https://raw.githubusercontent.com/johnnybui/postgres-backup-s3/v1.0.0/docker-compose.example.yml
curl -o .env https://raw.githubusercontent.com/johnnybui/postgres-backup-s3/v1.0.0/env.example

# 2. Edit .env with your configuration
nano .env

# 3. Start
docker compose up -d

# 4. View logs
docker compose logs -f postgres-backup

📊 Container Details

  • Base Image: Alpine Linux
  • Size: 416MB
  • PostgreSQL Client: Version 17
  • AWS CLI: Version 2.27+
  • Platforms: linux/amd64, linux/arm64

📖 Documentation

🆕 What's Changed

This is the initial stable release built with:

  • ✅ Bun + TypeScript for modern, fast runtime
  • ✅ Alpine Linux for minimal container size
  • ✅ Multiple database support
  • ✅ Native Cloudflare R2 support
  • ✅ Comprehensive documentation

🙏 Credits

This project is inspired by and based on itbm/postgresql-backup-s3.

📝 License

MIT License - See LICENSE for details.


Full Changelog: https://github.com/johnnybui/postgres-backup-s3/commits/v1.0.0