Implement a dedicated Docker container (backup-cron) for automated daily backups and maintenance tasks, eliminating the need for host cron configuration. New features: - backup-cron service: Alpine-based container with Docker CLI and cron - Automated daily backup at 5:00 AM (Europe/Paris timezone) - Automated health check at 6:00 AM (after backup) - Weekly log cleanup on Sundays at 3:00 AM (removes logs >30 days) Files added: - cron/Dockerfile: Alpine Linux with docker-cli, bash, and tzdata - cron/entrypoint.sh: Starts crond and displays configuration - cron/crontab: Scheduled tasks configuration - cron/README.md: Complete documentation for automated backups - scripts/clean-old-logs.sh: Automated log cleanup script Makefile enhancements: - make cron-status: Display backup automation status and schedule - make cron-logs: View logs from automated tasks Configuration improvements: - Auto-detect COMPOSE_PROJECT_NAME from directory name (portable) - Fix df command to use POSIX format (-P flag) for consistent output - Updated .env.example with COMPOSE_PROJECT_NAME documentation Benefits: - No host cron configuration required - Portable across different environments - Automatic timezone handling - Integrated with existing backup/health check scripts - Logs all automated tasks for monitoring 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
# ============================================
|
|
# MODE: dev | prod
|
|
# ============================================
|
|
# Copiez ce fichier vers .env et changez les valeurs
|
|
|
|
# Base de données
|
|
# IMPORTANT: Utilisez des mots de passe forts (min 32 caractères aléatoires)
|
|
# Générez avec: openssl rand -base64 32
|
|
MYSQL_DATABASE=nextcloud
|
|
MYSQL_ROOT_USER=root
|
|
MYSQL_ROOT_PASSWORD=CHANGEME_GENERATE_STRONG_PASSWORD
|
|
MYSQL_USER=nextcloud_user
|
|
MYSQL_PASSWORD=CHANGEME_GENERATE_STRONG_PASSWORD
|
|
|
|
# Redis
|
|
# IMPORTANT: Utilisez un mot de passe fort
|
|
REDIS_HOST_PASSWORD=CHANGEME_GENERATE_STRONG_PASSWORD
|
|
|
|
# Backups
|
|
BACKUP_DESTINATION=./backups
|
|
BACKUP_RETENTION_DAYS=7
|
|
|
|
# Docker Compose
|
|
# Le nom du projet est auto-détecté depuis le nom du dossier
|
|
# Vous pouvez le surcharger ici si nécessaire:
|
|
# COMPOSE_PROJECT_NAME=mon-nextcloud
|
|
|
|
# ============================================
|
|
# DÉVELOPPEMENT (localhost)
|
|
# ============================================
|
|
NEXTCLOUD_DOMAIN=localhost:8888
|
|
TRUSTED_PROXIES=
|
|
OVERWRITE_PROTOCOL=http
|
|
OVERWRITE_HOST=
|
|
OVERWRITE_CLI_URL=
|
|
|
|
# ============================================
|
|
# PRODUCTION (avec Traefik et SSL)
|
|
# ============================================
|
|
#NEXTCLOUD_DOMAIN=domain.tld
|
|
#TRUSTED_PROXIES=172.16.0.0/12
|
|
#OVERWRITE_PROTOCOL=https
|
|
#OVERWRITE_HOST=domain.tld
|
|
#OVERWRITE_CLI_URL=https://domain.tld
|