Database backups are handled by spatie/laravel-backup. The package is configured for DB-only backups by default, no file backups.
Two commands run daily via routes/console.php:
backup:run --only-db at 02:10 ESTbackup:clean at 02:15 ESTThe cleanup command removes old backups based on the retention policy in config/backup.php.
Backups write to the local disk by default (storage/app). For production you'd typically add an S3 disk to the destination.disks array in config/backup.php so backups live off-server.
The PHP container needs Oracle's mysqldump binary to dump the database. This is copied from the official MySQL image in the Dockerfile:
COPY --from=mysql:8.0 /usr/bin/mysqldump /usr/bin/mysqldump
A dump key in the mysql connection config (config/database.php) passes --ssl-mode=DISABLED --get-server-public-key to mysqldump. This is necessary because Docker's virtual network makes MySQL treat the connection as remote and enforce SSL, even though both containers are on the same host. Production deployments on a single server connect via localhost where MySQL doesn't enforce SSL, so these flags are harmless there.
# DB-only backup
php artisan backup:run --only-db
# Full backup (DB + files)
php artisan backup:run
# Clean old backups
php artisan backup:clean