Architecture Overview
The Docker deployment consists of three services:- Application: Web server running on FrankenPHP with Laravel Octane
- Queue: Background job processor for download tasks
- Scheduler: Laravel task scheduler for automated operations
Prerequisites
Before deploying, ensure you have:- Docker Engine 20.10+
- Docker Compose v2.0+
- Aria2 RPC server running on the host
- Meilisearch server running on the host (port 7700)
Quick Start
Configure environment variables
Copy the example environment file and configure it:Edit
.env and set the required variables:Build and start containers
Build the Docker images and start all services:This will:
- Build the frontend assets using Bun
- Create optimized PHP 8.4 containers with all required extensions
- Start all three services (application, queue, scheduler)
Service Configuration
Application Service
The main web application runs on port 8000:- Runs FrankenPHP with Laravel Octane for high performance
- Includes health check endpoint at
/up - Automatic cache optimization on startup
- Supports HTTP/2 and compression (zstd, brotli, gzip)
Queue Service
Processes background jobs for downloads:- Memory limit: 2048MB
- Timeout: Unlimited (long-running downloads)
- Retry attempts: 3
- Auto-restart on failure
Scheduler Service
Runs periodic tasks:- Media synchronization
- Cleanup tasks
- Index maintenance
Environment Variables
All services share these environment variables (from docker-compose.yml:11-13):| Variable | Default | Description |
|---|---|---|
DB_DATABASE | /data/database/database.sqlite | SQLite database path |
ARIA2_RPC_HOST | http://host.docker.internal | Aria2 RPC endpoint |
MEILISEARCH_HOST | http://host.docker.internal:7700 | Meilisearch server |
.env file:
| Variable | Description |
|---|---|
APP_KEY | Laravel application encryption key |
SYNC_MEDIA_MEMORY_LIMIT | Memory limit for media sync (default: 512M) |
HTTP_CLIENT_USER_AGENT | User agent for HTTP requests |
FEATURE_DIRECT_DOWNLOAD_LINKS | Enable direct download links |
Volume Management
The deployment uses persistent volumes:./data/database/database.sqlite and shared across all services.
HTTPS Configuration
To enable HTTPS, uncomment the HTTPS ports in docker-compose.yml:46-47:docker/Caddyfile to configure TLS certificates.
Startup Process
When containers start, the entrypoint script (docker/entrypoint.sh:1) performs:Managing Containers
View logs
Restart services
Stop and remove containers
Update deployment
Running Artisan Commands
Execute Laravel Artisan commands inside containers:Performance Tuning
The Dockerfile (docker/Dockerfile:38-43) includes optimized PHP settings:opcache- Bytecode cachingapcu- User cacheredis- Session/cache drivermemcached- Alternative cache driverimagick- Image processingzstd- Compression
Next Steps
- Review Production Deployment for optimization tips
- Check Troubleshooting for common issues
- Configure monitoring and logging for production use