/ apps / echo_shared / config / runtime.exs
runtime.exs
 1  import Config
 2  
 3  # Runtime configuration - evaluated when the application starts, not at compile time
 4  # This is the recommended place for environment-specific configuration in Elixir 1.9+
 5  
 6  # Configure database connection
 7  # These values can be overridden by environment variables for different deployments
 8  if config_env() != :test do
 9    config :echo_shared, EchoShared.Repo,
10      database: System.get_env("DB_NAME", "echo_org"),
11      username: System.get_env("DB_USER", "echo_org"),
12      password: System.get_env("DB_PASSWORD", "postgres"),
13      hostname: System.get_env("DB_HOST", "localhost"),
14      port: String.to_integer(System.get_env("DB_PORT", "5433")),
15      pool_size: String.to_integer(System.get_env("DB_POOL_SIZE", "1"))
16  end
17  
18  # Configure Redis connection
19  # Port 6383 is used instead of standard 6379 to avoid conflicts with local Redis
20  # when using Docker (Docker maps container 6379 -> host 6383)
21  config :echo_shared, :redis,
22    host: System.get_env("REDIS_HOST", "localhost"),
23    port: String.to_integer(System.get_env("REDIS_PORT", "6383"))
24  
25  # Configure Ollama (LLM) endpoint
26  config :echo_shared,
27    ollama_endpoint: System.get_env("OLLAMA_ENDPOINT", "http://localhost:11434"),
28    llm_enabled: System.get_env("LLM_ENABLED", "true") == "true"