Overview
This page documents all environment variables used across the application. Variables can be set indocker-compose.yml or in a .env file.
Backend Environment Variables
Database Settings
Complete PostgreSQL connection string. Overrides individual DB_* variables if set.
PostgreSQL server hostname or IP address.
PostgreSQL server port.
PostgreSQL database username.
PostgreSQL database password. Change in production!
PostgreSQL database name.
MinIO Object Storage
MinIO server endpoint (without http://). Use
host:port format.MinIO access key. Change in production!
MinIO secret key. Change in production!
MinIO bucket name for storing uploaded files and generated files.
Use HTTPS for MinIO connection. Set to
true for production.Redis Settings
Redis connection URL. Used for job state persistence and pub/sub messaging.
JWT Authentication
Secret key for signing JWT tokens. MUST change in production! Use a strong random string.
Algorithm for JWT signing. Options:
HS256, HS384, HS512.Access token expiration time in minutes.
Refresh token expiration time in days.
Application Settings
Ensures Python output is sent straight to terminal without buffering.
Application name displayed in API documentation.
Enable debug mode. Set to
true only in development.AI/LLM Settings
OpenRouter API base URL for LLM requests.
Default LLM model to use. Options:
openai/gpt-4o-mini- Fast & cheapgoogle/gemini-2.0-flash-exp- Fastermeta-llama/llama-2-70b-chat- Open source
Connection timeout for API requests in seconds.
Read timeout for long-running API requests in seconds.
Maximum retry attempts for failed API requests.
Initial retry delay in seconds (uses exponential backoff).
Processing Limits
Maximum allowed PDF file size in megabytes.
Maximum number of pages to extract from PDF documents.
Maximum number of tags to generate per document.
Minimum number of tags to generate per document.
Maximum words to send to AI model for processing.
Batch Processing
Maximum retries per document before skipping in batch processing.
Exponential backoff multiplier for batch retries.
Minimum delay between batch requests in seconds (for rate limiting).
Maximum delay between batch requests in seconds.
AWS Settings (Optional)
AWS access key for S3 integration. Optional if using MinIO.
AWS secret access key for S3 integration. Optional if using MinIO.
AWS region for S3 bucket. Only used if AWS credentials are provided.
Frontend Environment Variables
Backend API URL. Must be accessible from the browser for client-side requests.For production, use your domain:
Disables Next.js telemetry collection. Set automatically in Dockerfile.
Node environment. Set to
production or development.Internal port the Next.js app runs on inside the container.
Hostname to bind the server to. Use
0.0.0.0 for Docker.PostgreSQL Environment Variables
PostgreSQL superuser name created on initialization.
PostgreSQL superuser password. Change in production!
Default database created on initialization.
MinIO Environment Variables
MinIO root username. Change in production!
MinIO root password. Must be at least 8 characters. Change in production!
Production Configuration
Security Checklist
Before deploying to production, ensure you change these critical values:- ✅
JWT_SECRET_KEY- Use strong random string - ✅
DB_PASSWORD- Use strong password - ✅
POSTGRES_PASSWORD- Match DB_PASSWORD - ✅
MINIO_ROOT_USER- Change from default - ✅
MINIO_ROOT_PASSWORD- Use strong password (8+ chars) - ✅
MINIO_ACCESS_KEY- Match MINIO_ROOT_USER - ✅
MINIO_SECRET_KEY- Match MINIO_ROOT_PASSWORD - ✅
NEXT_PUBLIC_BACKEND_URL- Use production domain
Example Production .env
Environment File Location
Create a.env file in the project root (same directory as docker-compose.yml):
.env.
Override for Development
Createdocker-compose.override.yml for local development:
Validation
Verify environment variables are set correctly:Troubleshooting
Variables not taking effect
Connection refused errors
Ensure service hostnames match Docker network names:- ✅
DB_HOST=postgres(service name) - ❌
DB_HOST=localhost(wrong in Docker)