2.8 KiB
Production and On-Premise Deployment
MicroLearn ships one application image set for SaaS and dedicated On-Premise installations. DEPLOYMENT_MODE selects capabilities; it does not fork product code.
Prerequisites
- Docker Engine 26+ with Compose v2
- 4 CPU, 8 GB RAM, and storage sized for uploaded video/export retention
- DNS and TLS termination at the ingress/load balancer
- Unique MySQL, Redis, MinIO/S3 and application secrets
First boot
- Copy
infrastructure/production/.env.production.exampleto.env.productionoutside source control. For dedicated installs use the On-Premise template. - Generate
APP_KEYwithphp artisan key:generate --showand replace everyCHANGE_MEvalue. - Set
MICROLEARN_ENV_FILEand secret variables in the deployment environment. - Run
docker compose -f docker-compose.production.yml build --pull. - Run
docker compose -f docker-compose.production.yml run --rm app php artisan migrate --force. - Start with
docker compose -f docker-compose.production.yml up -d. - Verify
/api/v1/health; database and storage must reportok. Confirm worker and scheduler containers remain healthy in logs.
TLS terminates before Nginx. Forward the original scheme/host through the trusted ingress and keep PHP, MySQL, Redis and object storage on a private network. Never expose MinIO console or database ports publicly.
Scaling and operations
- Scale
workerindependently for ingestion/export/event load; keep--timeoutabove the largest export execution time. - Run one or more schedulers with Laravel
withoutOverlappinglocks backed by Redis. - Configure S3 lifecycle only after application export-retention policy; canonical Assets must not be expired by an export rule.
- Collect container logs, HTTP latency/error rate, queue depth/age, failed jobs, storage capacity, MySQL connections and scheduler heartbeat.
- Alert on health degradation, queue age, repeated export failures, low capacity, backup failure and certificate verification errors.
On-Premise
Set DEPLOYMENT_MODE=on_premise. Multi-organization and subscription SaaS controls are hidden by capabilities. External AI defaults off. FILESYSTEM_DISK/EXPORT_DISK may be local for one-node installs or s3 for MinIO-compatible storage. SMTP can remain log in disconnected environments.
Release and rollback
Before every release: take and verify a backup, build immutable versioned images, run CI, inspect migrations, then deploy app/worker/scheduler from the same image digest. Run migrations once. Roll back images only for backward-compatible migrations; otherwise follow the database restore runbook.
Disaster recovery
Define site-specific RPO/RTO. The reference scripts back up MySQL plus private application storage. Object-store versioning/replication supplements—but does not replace—tested restores. Perform a restore drill at least quarterly.