1- # Copy this file to .env and update with your values
1+ # Rendiff FFmpeg API - Production Environment Configuration
2+ # Copy this file to .env and configure for your environment
23
3- # Database Configuration
4- POSTGRES_PASSWORD = your_secure_password_here
5- POSTGRES_USER = ffmpeg_user
6- POSTGRES_DB = ffmpeg_api
7- DATABASE_URL = postgresql://ffmpeg_user:your_secure_password_here@postgres:5432/ffmpeg_api
4+ # =============================================================================
5+ # CORE APPLICATION SETTINGS
6+ # =============================================================================
87
9- # Redis/Queue Configuration
10- REDIS_URL = redis://redis:6379/0
8+ # Application Environment
9+ DEBUG = false
10+ TESTING = false
11+ VERSION = 1.0.0
1112
12- # API Configuration
13+ # API Server Configuration
1314API_HOST = 0.0.0.0
1415API_PORT = 8000
1516API_WORKERS = 4
16- LOG_LEVEL = info
17- DEBUG = false
17+ API_RELOAD = false
18+ API_LOG_LEVEL = info
19+
20+ # =============================================================================
21+ # DATABASE CONFIGURATION
22+ # =============================================================================
23+
24+ # Production PostgreSQL (Recommended)
25+ DATABASE_URL = postgresql://ffmpeg_user:your_secure_password@postgres:5432/ffmpeg_api
26+
27+ # Alternative: SQLite (Development Only)
28+ # DATABASE_URL=sqlite+aiosqlite:///data/rendiff.db
29+
30+ # Database Pool Settings
31+ DATABASE_POOL_SIZE = 20
32+ DATABASE_MAX_OVERFLOW = 40
33+
34+ # =============================================================================
35+ # QUEUE & CACHE CONFIGURATION
36+ # =============================================================================
37+
38+ # Redis Configuration
39+ REDIS_URL = redis://redis:6379/0
40+ REDIS_MAX_CONNECTIONS = 100
1841
1942# Worker Configuration
2043WORKER_CONCURRENCY = 4
21- CPU_WORKERS = 2
22- GPU_WORKERS = 0
44+ WORKER_PREFETCH_MULTIPLIER = 1
45+ WORKER_MAX_TASKS_PER_CHILD = 100
46+ WORKER_TASK_TIME_LIMIT = 21600
2347
24- # Storage Configuration
25- STORAGE_PATH = ./storage
48+ # =============================================================================
49+ # STORAGE CONFIGURATION
50+ # =============================================================================
51+
52+ # Storage Paths
2653STORAGE_CONFIG = /app/config/storage.yml
54+ STORAGE_PATH = ./storage
55+ TEMP_PATH = /tmp/rendiff
56+
57+ # Data Persistence Paths (for Docker volumes)
58+ POSTGRES_DATA_PATH = ./data/postgres
59+ REDIS_DATA_PATH = ./data/redis
60+ PROMETHEUS_DATA_PATH = ./data/prometheus
61+ GRAFANA_DATA_PATH = ./data/grafana
62+
63+ # =============================================================================
64+ # FFMPEG & PROCESSING CONFIGURATION
65+ # =============================================================================
2766
28- # Security Configuration
29- ADMIN_API_KEYS = your_admin_key_1,your_admin_key_2
30- RENDIFF_API_KEYS = your_client_key_1,your_client_key_2,your_client_key_3
67+ # FFmpeg Settings
68+ FFMPEG_THREADS = 0
69+ FFMPEG_PRESET = medium
70+ FFMPEG_CRF = 23
71+ FFMPEG_HARDWARE_ACCELERATION = auto
72+
73+ # =============================================================================
74+ # SECURITY & AUTHENTICATION
75+ # =============================================================================
76+
77+ # API Security
78+ API_KEY_HEADER = X-API-Key
3179ENABLE_API_KEYS = true
32- CORS_ORIGINS = https://localhost,http://localhost
80+ ENABLE_IP_WHITELIST = false
81+ IP_WHITELIST = 10.0.0.0/8,192.168.0.0/16
82+
83+ # Admin API Keys (comma-separated)
84+ ADMIN_API_KEYS = your_admin_key_here
85+
86+ # Rate Limiting
87+ ENABLE_RATE_LIMITING = true
88+ RATE_LIMIT_CALLS = 2000
89+ RATE_LIMIT_PERIOD = 3600
3390
34- # SSL/HTTPS Configuration (for production)
35- DOMAIN_NAME = localhost
36- CERTBOT_EMAIL = admin@example.com
37- CERT_RESOLVER = letsencrypt
38- LETSENCRYPT_STAGING = false
91+ # CORS Origins (comma-separated)
92+ API_CORS_ORIGINS = http://localhost,https://localhost,https://yourdomain.com
93+ API_TRUSTED_HOSTS = localhost,yourdomain.com
3994
40- # Monitoring Configuration
41- GRAFANA_PASSWORD = your_grafana_password_here
42- PROMETHEUS_AUTH = admin:your_prometheus_password_here
43- TRAEFIK_AUTH = admin:your_traefik_password_here
95+ # Database Passwords
96+ POSTGRES_PASSWORD = your_secure_postgres_password
4497
45- # Resource Limits
98+ # =============================================================================
99+ # MONITORING & OBSERVABILITY
100+ # =============================================================================
101+
102+ # Metrics & Monitoring
103+ ENABLE_METRICS = true
104+ METRICS_PORT = 9000
105+ ENABLE_TRACING = false
106+ TRACING_ENDPOINT =
107+
108+ # Grafana Configuration
109+ GRAFANA_PASSWORD = your_secure_grafana_password
110+
111+ # =============================================================================
112+ # RESOURCE LIMITS
113+ # =============================================================================
114+
115+ # Upload & Processing Limits
46116MAX_UPLOAD_SIZE = 10737418240
47- MAX_CONCURRENT_JOBS_PER_KEY = 10
48117MAX_JOB_DURATION = 21600
118+ MAX_CONCURRENT_JOBS_PER_KEY = 10
119+ JOB_RETENTION_DAYS = 7
120+
121+ # =============================================================================
122+ # WEBHOOKS & NOTIFICATIONS
123+ # =============================================================================
124+
125+ # Webhook Configuration
126+ WEBHOOK_TIMEOUT = 30
127+ WEBHOOK_MAX_RETRIES = 3
128+ WEBHOOK_RETRY_DELAY = 60
129+
130+ # =============================================================================
131+ # OPTIONAL SERVICES
132+ # =============================================================================
133+
134+ # Virus Scanning (Optional)
135+ ENABLE_VIRUS_SCAN = false
136+ CLAMAV_HOST =
137+ CLAMAV_PORT = 3310
138+
139+ # =============================================================================
140+ # DEPLOYMENT SPECIFIC
141+ # =============================================================================
142+
143+ # Docker Compose Profiles
144+ # Uncomment the profile you want to use:
145+ # COMPOSE_PROFILES=standard # Standard CPU-only deployment
146+ # COMPOSE_PROFILES=gpu # GPU-accelerated deployment
147+ # COMPOSE_PROFILES=monitoring # Include Prometheus/Grafana
148+ # COMPOSE_PROFILES=gpu,monitoring # GPU + Monitoring
149+
150+ # Network Configuration
151+ # COMPOSE_PROJECT_NAME=ffmpeg-api
152+
153+ # =============================================================================
154+ # CLOUD STORAGE (Optional)
155+ # =============================================================================
156+
157+ # AWS S3
158+ # AWS_ACCESS_KEY_ID=your_access_key
159+ # AWS_SECRET_ACCESS_KEY=your_secret_key
160+ # AWS_DEFAULT_REGION=us-west-2
161+ # S3_BUCKET_NAME=your-video-bucket
162+
163+ # Azure Blob Storage
164+ # AZURE_STORAGE_ACCOUNT=your_account
165+ # AZURE_STORAGE_KEY=your_key
166+ # AZURE_CONTAINER_NAME=videos
167+
168+ # Google Cloud Storage
169+ # GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
170+ # GCS_BUCKET_NAME=your-video-bucket
171+
172+ # =============================================================================
173+ # SSL/TLS CONFIGURATION
174+ # =============================================================================
175+
176+ # SSL Certificate Paths (for production)
177+ # SSL_CERT_PATH=/etc/ssl/certs/your-cert.crt
178+ # SSL_KEY_PATH=/etc/ssl/private/your-key.key
49179
50- # External URLs
51- EXTERNAL_URL = https://localhost
180+ # Let's Encrypt (for automatic SSL)
181+ # LETSENCRYPT_EMAIL=admin@yourdomain.com
182+ # LETSENCRYPT_HOST=yourdomain.com
0 commit comments