Redis Configuration
Configure the caching and state management layer.
Configuration Precedence
If url is provided, it takes precedence over hostname, port, password, etc.
Security Warning
NEVER put production credentials in moose.config.toml. For production environments or when connecting to external infrastructure, ALWAYS use environment variables and/or secrets to securely inject credentials.
[redis_config]# Redis connection URL (Default: "redis://127.0.0.1:6379")url = "redis://127.0.0.1:6379"# Namespace prefix for all Redis keys (Default: "MS")key_prefix = "MS"| Key | Env Variable | Default | Description |
|---|---|---|---|
url | MOOSE_REDIS_CONFIG__URL | "redis://127.0.0.1:6379" | Full connection URL. |
key_prefix | MOOSE_REDIS_CONFIG__KEY_PREFIX | "MS" | Prefix for keys used by Moose. |
Docker Compose Port Binding
When running moose dev, Moose generates a docker-compose.yml that exposes Redis on the host. The host-side port is derived from the port in url:
[redis_config]url = "redis://127.0.0.1:6380" # host port → 6380This produces the following mapping in .moose/docker-compose.yml:
ports: - "6380:6379" # host:containerThe container-side port is always 6379 (the Redis default). Only the host-side port changes based on your url.