feat: Prepare Zemailnator for Dokploy deployment

- Add highly optimized Dockerfile with Nginx and PHP-FPM 8.4
- Add docker-compose.yml configured with Redis and MariaDB 10.11
- Implement entrypoint.sh and supervisord.conf for background workers
- Refactor legacy IMAP scripts into scheduled Artisan Commands
- Secure app by removing old routes with hardcoded basic auth credentials
- Configure email attachments to use Laravel Storage instead of insecure public/tmp
This commit is contained in:
idevakk
2026-02-28 23:17:39 +05:30
parent bf5b797cd8
commit c312ec3325
78 changed files with 750 additions and 360 deletions

View File

@@ -1,27 +1,22 @@
<?php
use App\Models\Log;
use App\Models\Email;
use App\Models\Log;
use App\Models\Ticket;
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
Artisan::command('inspire', function (): void {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
// Schedule::call(function () {
// Email::fetchProcessStoreEmail();
// })->everyMinute();
Schedule::call(function (): void {
Email::deleteBulkAttachments();
})->daily();
// Schedule::call(function () {
// Email::deleteBulkMailboxes();
// })->everyMinute();
// Schedule the new commands instead of closures
Schedule::command('emails:fetch')->everyMinute();
Schedule::command('attachments:clean')->daily();
Schedule::command('mailbox:clean')->everyTwoHours();
// Keep other necessary schedules
Schedule::call(function (): void {
Email::deleteMessagesFromDB();
})->everyTwoHours();
@@ -30,10 +25,7 @@ Schedule::call(function (): void {
Log::deleteLogsFromDB();
})->everyThreeHours();
Schedule::call(function (): void {
Email::cleanMailbox();
});
// Preserve existing commands
Artisan::command('cleanMail', function (): void {
$this->comment(Email::cleanMailbox());
});