mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-23 00:05:09 +00:00
- Introduced backup scripts for S3 and Google Drive, including cron job setup for automated backups. - Added email configuration script to set up SMTP settings for ERPNext. - Created environment files for backup configurations (backup.env, gdrive-backup.env, email.env). - Updated docker-compose files to support new backup services and configurations.
34 lines
No EOL
1.1 KiB
YAML
34 lines
No EOL
1.1 KiB
YAML
services:
|
|
backup:
|
|
image: frappe/erpnext:v15.54.4
|
|
entrypoint: ["bash", "-c"]
|
|
command:
|
|
- |
|
|
# Create a backup of all sites with files
|
|
bench --site all backup --with-files
|
|
|
|
# Upload backups to S3
|
|
for site_path in /home/frappe/frappe-bench/sites/*/; do
|
|
site=$(basename "$site_path")
|
|
if [ -d "${site_path}backup" ]; then
|
|
echo "Pushing backup for $site to S3..."
|
|
cd "${site_path}backup"
|
|
# Use aws cli to sync backups to S3
|
|
aws s3 sync . s3://${S3_BUCKET}/${site}/$(date +%Y-%m-%d)/
|
|
fi
|
|
done
|
|
|
|
# Cleanup old backups (keeping last 7 days)
|
|
find /home/frappe/frappe-bench/sites/*/backup -type f -mtime +7 -delete
|
|
environment:
|
|
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
|
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
|
- S3_BUCKET=${S3_BUCKET}
|
|
- AWS_DEFAULT_REGION=${S3_REGION}
|
|
volumes:
|
|
- sites:/home/frappe/frappe-bench/sites
|
|
|
|
volumes:
|
|
sites:
|
|
external: true
|
|
name: frappe_docker_sites |