Skip to content

DeviantEng/docker-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Docker Manager

Centralized Docker backup and update management CLI application for managing multiple Docker hosts.

Repository: https://github.com/DeviantEng/docker-manager

Features

  • βœ… Automated Backups - Stop, backup, restart projects safely (preserves container state)
  • βœ… Flexible Scheduling - Daily, weekly, biweekly, monthly per project
  • βœ… Smart Updates - Automatic updates after backups (configurable)
  • βœ… Retention Management - Keep last N backups per project with auto-cleanup
  • βœ… Selective Backups - Exclude volumes, patterns, or backup only compose files
  • βœ… Multi-Host - Manage multiple Docker hosts from one central machine
  • βœ… Notifications - ntfy integration with retry logic for reliable alerts
  • βœ… SSH-based - Secure remote execution via SSH keys
  • βœ… YAML Configuration - Easy, readable configuration with per-project overrides
  • βœ… State Preservation - Containers return to their original state (running/stopped)
  • βœ… Docker Prune - Weekly cleanup of unused images, containers, build cache on hosts
  • βœ… Log Cleanup - Automatic removal of old log files (default: 30 days retention)

Prerequisites

  • Python 3.8+
  • SSH access to Docker hosts (root with SSH keys configured)
  • NFS share mounted on all hosts and admin machine
  • pigz installed on Docker hosts (optional, for faster compression)

Quick Start

# Clone repository
git clone https://github.com/DeviantEng/docker-manager.git /opt/docker-manager
cd /opt/docker-manager

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Configure
cp docker-manager.yml.example docker-manager.yml
nano docker-manager.yml

# Create log directory
mkdir -p /var/log/docker-manager

# Test
./docker-manager.py test-ssh
./docker-manager.py test-notify
./docker-manager.py list

# Run first backup
./docker-manager.py backup --host docker01 your-project

# Setup daily cron
crontab -e
# Add: 0 2 * * * /opt/docker-manager/venv/bin/python3 /opt/docker-manager/docker-manager.py run

See SETUP.md for detailed installation instructions.

Configuration

Minimal Configuration

global:
  hosts:
    docker01:
      ip: 192.168.1.101
      docker_root: /opt/docker
  
  backup:
    root: /mnt/nfs/docker-backups
    default_schedule: weekly
    default_retention: 4
  
  notifications:
    enabled: true
    provider: ntfy
    ntfy:
      server: https://ntfy.example.com
      topic: docker-manager
      username: user
      password: pass

Project Overrides

projects:
  # Critical service - daily backups, keep 14
  vaultwarden:
    retention: 14
    schedule: daily
  
  # Skip backup, only update
  musicbrainz:
    behavior: update_only
  
  # Exclude cache/logs from backup
  plex:
    schedule: weekly
    exclude_patterns:
      - "*/Logs/*"
      - "*/Cache/*"

Docker Prune and Log Cleanup

global:
  docker_prune:
    enabled: true
    schedule: weekly         # daily, weekly, biweekly, monthly
    include_volume_prune: true
    # marker_file: /path/to/.last-docker-prune  # optional; default: {backup.root}/.last-docker-prune
  
  log_retention_days: 30    # Remove log files older than N days

Per-host overrides: Add docker_prune under a host to disable (enabled: false), change schedule, or skip volume prune.

See docker-manager.yml.example for all options.

Usage

Daily Automated Run

# Scheduled via cron (respects schedules, performs cleanup)
./docker-manager.py run

Manual Operations

# Backup operations
./docker-manager.py backup all                           # All projects
./docker-manager.py backup --host docker01               # All on one host
./docker-manager.py backup --host docker01 vaultwarden   # Specific project

# Update operations
./docker-manager.py update all                           # Check all for updates
./docker-manager.py update vaultwarden                   # Update specific project

# Combined (backup then update)
./docker-manager.py run --force                          # Force all, ignore schedules
./docker-manager.py run --host docker01 vaultwarden      # One project

# Maintenance
./docker-manager.py cleanup        # Remove old backups and logs per retention
./docker-manager.py docker-prune   # Run docker prune on hosts (manual, bypasses schedule)
./docker-manager.py docker-prune --host docker01   # Prune specific host only
./docker-manager.py list           # Show all discovered projects
./docker-manager.py test-ssh       # Test connectivity
./docker-manager.py test-notify    # Test notifications

How It Works

Backup Process

  1. Check if backup is due based on schedule
  2. SSH to Docker host
  3. Check container state (running/stopped)
  4. Stop containers (if running)
  5. Create compressed tar backup (excluding configured patterns)
  6. Check for updates (if backup_then_update)
  7. Start containers (if they were running)
  8. Clean up old backups per retention policy

Scheduling

The schedule setting controls both backup AND update frequency:

  • daily - Backup + update every day
  • weekly - Backup + update once per week (if last backup >7 days)
  • biweekly - Backup + update every 2 weeks
  • monthly - Backup + update once per month

Schedules are checked by parsing timestamps from backup filenames.

Behavior Modes

  • backup_then_update - Backup, then check for updates (default)
  • backup_only - Backup without checking for updates
  • update_only - Check for updates without backing up

State Preservation

Containers are always returned to their original state:

  • If running before backup β†’ Stopped β†’ Backed up β†’ Updated β†’ Started
  • If stopped before backup β†’ Backed up β†’ Remain stopped (no update check)

Docker Prune

When run is executed, docker prune runs on each host if due (same schedule logic as backups). It removes:

  • Stopped containers
  • Unused images
  • Build cache
  • Orphaned volumes (if include_volume_prune: true)

Schedule is tracked per-host via a marker file (default: {backup.root}/.last-docker-prune).

Log Cleanup

After each run, log files older than log_retention_days (default 30) are removed from log_dir.

Backup Format

Backups are named: {hostname}-{project}-{timestamp}.tar.gz

Examples:

docker01-vaultwarden-20241204-103000.tar.gz
docker01-jellyfin-20241204-103005.tar.gz
docker02-plex-20241204-103010.tar.gz

Each backup contains:

  • docker-compose.yml and related files
  • All volumes (unless excluded)
  • .env files
  • Project directory structure

Exclusion Patterns

Control what gets backed up:

Global Defaults

global:
  backup:
    default_exclude_patterns:
      - "*.log"
      - "*.sock"
      - "*/cache/*"
      - "*/logs/*"

Per-Project Patterns

projects:
  plex:
    exclude_patterns:
      - "*/Logs/*"
      - "*/Cache/*"
      - "*/Crash Reports/*"

See EXCLUSIONS.md for pattern examples and guidance.

Notifications

Notifications are sent via ntfy with automatic retry logic.

Backup Summary:

🐳 Docker Manager: 12 backups completed

πŸ’Ύ Backup Complete
━━━━━━━━━━━━━━━━━━━━
Projects: 12 (45 containers)
βœ… Successful: 12

Total Size: 5.2GB

Update Summary:

🐳 Docker Manager: 3 updates applied

πŸ”„ Updates Complete
━━━━━━━━━━━━━━━━━━━━
Checked: 12 projects
βœ… Updated: 3
βœ”οΈ Up-to-date: 9

Restoration

To restore a backup:

# 1. SSH to host
ssh root@docker01

# 2. Stop service
cd /opt/docker/vaultwarden
docker compose down

# 3. Extract backup
cd /opt/docker
tar -xzf /mnt/nfs/docker-backups/docker01-vaultwarden-20241204-103000.tar.gz -C vaultwarden/

# 4. Start service
cd vaultwarden
docker compose up -d

Monitoring

# Check logs
tail -f /var/log/docker-manager/docker-manager-$(date +%Y%m%d).log

# Review last run
tail -100 /var/log/docker-manager/docker-manager-$(date +%Y%m%d).log

# Check backup sizes
du -sh /mnt/nfs/docker-backups/*

# List backups per project
ls -lh /mnt/nfs/docker-backups/ | grep vaultwarden

Troubleshooting

Dependencies Not Installed

source venv/bin/activate
pip install -r requirements.txt

SSH Connection Issues

# Test manually
ssh root@192.168.1.101 "echo OK"

# Check SSH keys
ls -la ~/.ssh/

# Use built-in test
./docker-manager.py test-ssh

Notifications Not Working

# Test notification
./docker-manager.py test-notify

# Check configuration
grep -A 6 "notifications:" docker-manager.yml

Backups Not Running

# Check schedule (might not be due yet)
./docker-manager.py run --force

# Check logs
tail -100 /var/log/docker-manager/docker-manager-$(date +%Y%m%d).log

Project Structure

/opt/docker-manager/
β”œβ”€β”€ docker-manager.py           # Main application
β”œβ”€β”€ docker-manager.yml          # Your configuration (gitignored)
β”œβ”€β”€ docker-manager.yml.example  # Example configuration
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ .gitignore                  # Git ignore rules
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ SETUP.md                    # Detailed setup guide
β”œβ”€β”€ EXCLUSIONS.md               # Exclusion pattern guide
└── venv/                       # Virtual environment (gitignored)

/var/log/docker-manager/
└── docker-manager-YYYYMMDD.log  # Daily logs

Security Notes

  • Protect docker-manager.yml with chmod 600 (contains credentials)
  • Use SSH keys (not passwords) for host access
  • Secure your NFS share with proper permissions
  • Review logs for sensitive information before sharing

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

MIT

Support

Author

DeviantEng - https://github.com/DeviantEng

Features

  • βœ… Automated Backups - Stop, backup, restart projects safely
  • βœ… Flexible Scheduling - Daily, weekly, biweekly, monthly per project
  • βœ… Smart Updates - Automatic updates after backups (configurable)
  • βœ… Retention Management - Keep last N backups per project
  • βœ… Selective Backups - Exclude volumes, backup only compose files
  • βœ… Multi-Host - Manage multiple Docker hosts from one place
  • βœ… Notifications - ntfy integration for status updates
  • βœ… SSH-based - Secure remote execution via SSH
  • βœ… YAML Configuration - Easy, readable configuration

Prerequisites

  • Python 3.8+
  • SSH access to Docker hosts (root with SSH keys)
  • NFS share mounted on all hosts and admin machine
  • pigz installed on Docker hosts (optional, for faster compression)

Installation

# Clone repository
git clone https://github.com/yourusername/docker-manager.git /opt/docker-manager
cd /opt/docker-manager

# Install Python dependencies
pip3 install -r requirements.txt

# Make executable
chmod +x docker-manager.py

# Create symlink (optional, for convenience)
ln -s /opt/docker-manager/docker-manager.py /usr/local/bin/docker-manager

# Create log directory
mkdir -p /var/log/docker-manager

Configuration

Copy the example configuration and customize:

cp docker-manager.yml.example docker-manager.yml
nano docker-manager.yml

Required settings:

  • global.hosts - Your Docker hosts with friendly names and IPs
  • global.backup.root - Path to NFS backup directory
  • global.notifications.ntfy - Your ntfy server credentials

Optional:

  • projects - Per-project overrides (schedule, retention, exclusions)

See docker-manager.yml.example for detailed configuration options.

Quick Start

# Test SSH connectivity to all hosts
./docker-manager.py test-ssh

# Test notifications
./docker-manager.py test-notify

# List all discovered projects
./docker-manager.py list

# Test backup a single project
./docker-manager.py backup --host docker01 vaultwarden

# Check logs
tail -f /var/log/docker-manager/docker-manager-$(date +%Y%m%d).log

Usage

Main Operations

# Run scheduled backups and updates (respects schedule config)
docker-manager.py run

# Force run everything regardless of schedule
docker-manager.py run --force

# Run specific host or project
docker-manager.py run --host docker01
docker-manager.py run vaultwarden

Backup Operations

# Backup all projects
docker-manager.py backup all

# Backup specific project on all hosts
docker-manager.py backup vaultwarden

# Backup all projects on specific host
docker-manager.py backup --host docker01

# Backup specific project on specific host
docker-manager.py backup --host docker01 vaultwarden

Update Operations

# Update all projects
docker-manager.py update all

# Update specific project
docker-manager.py update vaultwarden

# Update all on specific host
docker-manager.py update --host docker02

# Update specific project on specific host
docker-manager.py update --host docker02 jellyfin

Maintenance

# Clean up old backups (respects retention policy)
docker-manager.py cleanup

# List all projects
docker-manager.py list

Testing

# Test SSH connectivity
docker-manager.py test-ssh

# Test notifications
docker-manager.py test-notify

Automated Execution

Set up a daily cron job:

crontab -e

Add:

0 2 * * * /opt/docker-manager/docker-manager.py run

This runs daily at 2 AM, checking each project's schedule and backing up/updating as configured.

Configuration

Global Settings

global:
  # Host definitions
  hosts:
    docker01:
      ip: 192.168.1.101
      docker_root: /opt/docker
    docker02:
      ip: 192.168.1.102
      docker_root: /opt/docker
  
  # Backup settings
  backup:
    root: /mnt/media/nfs/docker-backups
    compression: pigz  # pigz (faster) or gzip
    compression_level: 6  # 1-9
    default_retention: 4  # Keep last N backups per project
    default_schedule: daily  # daily, weekly, biweekly, monthly
    
    # Global exclusion patterns (optional)
    default_exclude_patterns:
      - "*.log"
      - "*.sock"
      - "*/cache/*"
      - "*/logs/*"
  
  # Update settings
  update:
    default_behavior: backup_then_update  # backup_then_update, backup_only, update_only
  
  # Notifications
  notifications:
    enabled: true
    provider: ntfy
    ntfy:
      server: https://ntfy.example.com
      topic: your-topic
      username: your-user
      password: your-pass

Project Overrides

Projects not listed use global defaults. Add per-project customization:

projects:
  # High-value service: daily backups, keep 10
  vaultwarden:
    retention: 10
    schedule: daily
    behavior: backup_then_update
  
  # Skip backup entirely, only update
  musicbrainz:
    behavior: update_only
    schedule: weekly
  
  # Media server: weekly backups, exclude cache
  jellyfin:
    retention: 6
    schedule: weekly
    exclude_volumes:
      - cache
      - transcodes
  
  # Database: daily backup, never auto-update
  postgres:
    retention: 10
    schedule: daily
    behavior: backup_only
  
  # Only backup compose files, no volumes
  nginx:
    retention: 4
    exclude_volumes:
      - ALL  # Special keyword

Configuration Options

Per-Project Settings

  • retention - Keep last N backups (overrides default)
  • schedule - daily, weekly, biweekly, monthly
  • behavior - backup_then_update, backup_only, update_only
  • backup_compose - false to skip compose files (default: true)
  • exclude_volumes - List of volume directories to skip
    • Use ALL to exclude all volumes (backup only compose files)
  • exclude_patterns - List of file/path patterns to exclude (per-project)
    • Patterns are passed to tar --exclude
    • Merged with default_exclude_patterns from global config
    • Examples: "*/Logs/*", "*.tmp", "*/Cache/*"

Example: Plex with Custom Exclusions

projects:
  plex:
    retention: 4
    schedule: weekly
    exclude_patterns:
      - "*/Logs/*"           # Skip Plex logs
      - "*/Cache/*"          # Skip Plex cache
      - "*/Crash Reports/*"  # Skip crash reports
      # Metadata is backed up (not excluded)

How It Works

Backup Process

For each project:

  1. Check if backup is due based on schedule and last backup timestamp
  2. SSH to Docker host
  3. docker compose down (stop containers)
  4. Create compressed tar backup (excluding configured volumes)
  5. docker compose up -d (restart containers)
  6. Clean up old backups based on retention policy

Update Process

For projects where behavior allows:

  1. SSH to Docker host
  2. Get current image digests
  3. docker compose pull
  4. Compare new vs old digests
  5. If changed: docker compose up -d (recreate containers)

Scheduling

Backup schedules are enforced by parsing the timestamp from existing backup filenames:

  • daily - Backup if last backup was >24 hours ago
  • weekly - Backup if last backup was >7 days ago
  • biweekly - Backup if last backup was >14 days ago
  • monthly - Backup if last backup was >30 days ago

Projects without existing backups are always backed up.

Backup Format

Backups are named: {hostname}-{project}-{timestamp}.tar.gz

Examples:

docker01-vaultwarden-20241204-103000.tar.gz
docker01-jellyfin-20241204-103005.tar.gz
docker02-plex-20241204-103010.tar.gz

Restoration

To restore a backup:

# 1. SSH to the host
ssh root@docker01

# 2. Stop the service
cd /opt/docker/vaultwarden
docker compose down

# 3. Extract backup over existing directory
cd /opt/docker
tar -xzf /mnt/media/nfs/docker-backups/docker01-vaultwarden-20241204-103000.tar.gz -C vaultwarden/

# 4. Restart service
cd vaultwarden
docker compose up -d

Notifications

Backup Summary

🐳 Docker Manager: 12 backups completed
━━━━━━━━━━━━━━━━━━━━
Total: 14 projects
βœ… Successful: 12
❌ Failed: 2

Total Size: 3.2GB

Update Summary

🐳 Docker Manager: 3 updates applied
━━━━━━━━━━━━━━━━━━━━
Checked: 14 projects
βœ… Updated: 3
βœ”οΈ Up-to-date: 11

Cleanup Notification

🐳 Docker Manager: Cleanup Complete
━━━━━━━━━━━━━━━━━━━━
Backups removed: 5
Space freed: 12.3GB

Troubleshooting

Dependencies Not Installed

# Install from requirements.txt
pip3 install -r requirements.txt

# Or install individually
pip3 install paramiko pyyaml requests python-dateutil

SSH Connection Issues

# Test SSH manually
ssh root@172.16.100.200 "echo OK"

# Check SSH keys exist
ls -la ~/.ssh/

# Use test-ssh command
./docker-manager.py test-ssh

Backups Not Running

# Check logs
tail -100 /var/log/docker-manager/docker-manager-$(date +%Y%m%d).log

# Force run to ignore schedules
./docker-manager.py run --force

# Test specific project
./docker-manager.py backup --host docker01 vaultwarden

Notifications Not Working

# Test notification
./docker-manager.py test-notify

# Check configuration
grep -A 6 "notifications:" docker-manager.yml

Project Structure

/opt/docker-manager/
β”œβ”€β”€ docker-manager.py           # Main application
β”œβ”€β”€ docker-manager.yml          # Your configuration
β”œβ”€β”€ docker-manager.yml.example  # Example configuration
β”œβ”€β”€ requirements.txt            # Python dependencies
└── README.md                   # This file

/var/log/docker-manager/
└── docker-manager-YYYYMMDD.log  # Daily logs

Development

Adding New Features

The code is structured for easy extension:

class DockerManager:
    def backup_project()   # Backup logic
    def update_project()   # Update logic
    def run()             # Main orchestration

class Notifier:
    def send()            # Send notifications

Testing

# Test SSH
python3 docker-manager.py test-ssh

# Test notifications
python3 docker-manager.py test-notify

# Dry run (view discovered projects)
python3 docker-manager.py list

Security

  • SSH keys should be properly secured (not password-based auth)
  • Protect docker-manager.yml as it contains ntfy credentials: chmod 600 docker-manager.yml
  • Backups contain all project data including secrets - secure the NFS share
  • Logs may contain sensitive information - review log permissions

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT

Support

For issues, check logs at /var/log/docker-manager/ or open an issue on GitHub.

Configuration

Edit /opt/docker-manager/docker-manager.yml:

global:
  hosts:
    docker01:
      ip: 172.16.100.200
      docker_root: /opt/docker
  
  backup:
    root: /mnt/media/nfs/docker-backups
    default_retention: 4
    default_schedule: daily
  
  notifications:
    enabled: true
    provider: ntfy
    ntfy:
      server: https://ntfy.example.com
      topic: your-topic
      username: user
      password: pass

projects:
  vaultwarden:
    retention: 8
    schedule: daily
  
  jellyfin:
    exclude_volumes:
      - cache
      - transcodes

Configuration Options

Global Settings

  • hosts - Define Docker hosts with friendly names
  • backup.root - NFS path for backups
  • backup.compression - pigz (faster) or gzip
  • backup.default_retention - Keep last N backups
  • backup.default_schedule - daily, weekly, biweekly, monthly
  • update.default_behavior - backup_then_update, backup_only, update_only

Project Settings

Projects not listed use global defaults. Override per project:

  • retention - Keep last N backups for this project
  • schedule - Backup frequency for this project
  • behavior - Override update behavior
  • backup_compose - Set to false to skip compose files
  • exclude_volumes - List of volume directories to skip
    • Use ALL to exclude all volumes (backup only compose)

Usage

Testing

# Test SSH connectivity
docker-manager test-ssh

# Test notifications
docker-manager test-notify

# List all discovered projects
docker-manager list

Backup Operations

# Backup all projects (respects schedule)
docker-manager run

# Force backup all (ignore schedule)
docker-manager run --force

# Backup specific project on all hosts
docker-manager backup vaultwarden

# Backup all projects on specific host
docker-manager backup --host docker01

# Backup specific project on specific host
docker-manager backup --host docker01 vaultwarden

Update Operations

# Update all projects (respects behavior settings)
docker-manager update all

# Update specific project
docker-manager update vaultwarden

# Update all on specific host
docker-manager update --host docker02

Maintenance

# Clean up old backups (respects retention)
docker-manager cleanup

# Show status (not yet implemented)
docker-manager status

Cron Setup

Run daily at 2 AM:

crontab -e

Add:

0 2 * * * /usr/local/bin/docker-manager run

How It Works

Backup Process

For each project:

  1. Check if backup is due based on schedule
  2. SSH to host
  3. docker compose down (stop containers)
  4. Create tar.gz backup (with exclusions)
  5. docker compose up -d (restart containers)
  6. Enforce retention policy (delete old backups)

Update Process

For each project (if behavior allows):

  1. SSH to host
  2. Get current image digests
  3. docker compose pull (check for updates)
  4. Compare new vs old digests
  5. If changed: docker compose up -d (recreate containers)

Scheduling Logic

When running docker-manager run:

  • Parse last backup timestamp from filename
  • Calculate days since last backup
  • Compare to project schedule setting
  • Backup if due, skip if not

Example:

  • Project with daily schedule, last backup yesterday β†’ Skip
  • Project with weekly schedule, last backup 8 days ago β†’ Backup
  • Project with no backups β†’ Always backup

Backup File Format

{hostname}-{project}-{timestamp}.tar.gz

Examples:
docker01-vaultwarden-20241204-103000.tar.gz
docker01-jellyfin-20241204-103005.tar.gz
docker02-plex-20241204-103010.tar.gz

Notifications

Backup Summary

🐳 Docker Manager: 12 backups completed
━━━━━━━━━━━━━━━━━━━━
Total: 14 projects
βœ… Successful: 12
❌ Failed: 2

Total Size: 3.2GB

Update Summary

🐳 Docker Manager: 3 updates applied
━━━━━━━━━━━━━━━━━━━━
Checked: 14 projects
βœ… Updated: 3
βœ”οΈ Up-to-date: 11

Cleanup Notification

🐳 Docker Manager: Cleanup Complete
━━━━━━━━━━━━━━━━━━━━
Backups removed: 5
Space freed: 12.3GB

Troubleshooting

SSH Connection Fails

# Test SSH manually
ssh root@172.16.100.200 "echo OK"

# Check SSH keys
ls -la ~/.ssh/

Dependencies Missing

# Reinstall dependencies
pip3 install -r /opt/docker-manager/requirements.txt

Backups Not Running

# Check logs
tail -100 /var/log/docker-manager/docker-manager-$(date +%Y%m%d).log

# Run with verbose output
docker-manager run --force

Notifications Not Working

# Test notification
docker-manager test-notify

# Check config
cat /opt/docker-manager/docker-manager.yml | grep -A 6 notifications

Examples

Example 1: Backup Important Service Daily, Keep 10 Copies

projects:
  postgres-db:
    retention: 10
    schedule: daily
    behavior: backup_only  # Don't auto-update

Example 2: Weekly Backups, Exclude Cache

projects:
  jellyfin:
    retention: 4
    schedule: weekly
    exclude_volumes:
      - cache
      - transcodes

Example 3: Backup Compose Only (No Volumes)

projects:
  documentation:
    retention: 2
    schedule: monthly
    exclude_volumes:
      - ALL

Example 4: Skip Backups, Only Update

projects:
  musicbrainz:
    behavior: update_only
    schedule: weekly

Security Notes

  • Uses root SSH keys for host access
  • Stores ntfy credentials in config file (protect with chmod 600)
  • Backups contain all project data including secrets
  • Ensure NFS share has proper permissions

Requirements

  • Python 3.8+
  • SSH access to Docker hosts (root with keys)
  • NFS share mounted on all hosts and admin machine
  • pigz installed on Docker hosts (optional, for faster compression)

Project Structure

/opt/docker-manager/
β”œβ”€β”€ docker-manager.py      # Main application
β”œβ”€β”€ docker-manager.yml     # Configuration
β”œβ”€β”€ requirements.txt       # Python dependencies
└── README.md             # This file

/var/log/docker-manager/
└── docker-manager-YYYYMMDD.log  # Daily logs

License

MIT

Support

Check logs at /var/log/docker-manager/ for detailed information.

About

Simple manager script to handle backups and updates to dockers running via compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages