The LeftPlot backend uses Redis for caching and session management. Redis is optional - if not configured, the application will run without caching functionality.
Set the REDIS_URL environment variable:
export REDIS_URL="redis://localhost:6379"In your docker-compose.yml, set the REDIS_URL:
environment:
- REDIS_URL=redis://your-redis-host:6379If you're using Docker secrets, you can create a Redis URL secret:
# Create the secret file
echo "redis://your-redis-host:6379" > leftplot/secrets/redis_url.txt
# Add to docker-compose.yml
secrets:
redis_url:
file: leftplot/secrets/redis_url.txtThe Redis URL should follow this format:
redis://[username:password@]host[:port][/database]
Examples:
redis://localhost:6379(local Redis, no auth)redis://user:pass@redis.example.com:6379(remote Redis with auth)redis://redis.example.com:6379/1(specific database)
This error occurs when:
REDIS_URLis undefinedREDIS_URLhas an invalid format- Redis server is not accessible
Solutions:
- Ensure
REDIS_URLis properly set in your environment - Check that the Redis URL format is correct
- Verify Redis server is running and accessible
- If Redis is not needed, the application will run without it
If you see Redis connection errors:
- Check if Redis server is running
- Verify the host and port are correct
- Check firewall settings
- Ensure authentication credentials are correct (if using auth)
If you don't want to use Redis, simply don't set the REDIS_URL environment variable. The application will:
- Skip Redis client initialization
- Disable caching functionality
- Continue to work normally for all other features
- Use Redis for caching to improve performance
- Set up Redis with authentication for security
- Use Redis persistence to avoid data loss
- Monitor Redis memory usage to prevent issues
- Set up Redis clustering for high availability