Some checks failed
Build and Publish / build-release (push) Failing after 1s
66 lines
1.7 KiB
Elixir
66 lines
1.7 KiB
Elixir
import Config
|
|
|
|
logger_level =
|
|
case System.get_env("LOG_LEVEL", "info") do
|
|
"debug" -> :debug
|
|
"info" -> :info
|
|
"warn" -> :warning
|
|
"error" -> :error
|
|
val when val in ["warning", "error"] -> :error
|
|
_ -> :info
|
|
end
|
|
|
|
config :logger, level: logger_level
|
|
|
|
config :logger, :console, format: {Logger.Formatter, :format}
|
|
|
|
if System.get_env("PHX_SERVER") do
|
|
config :customer_service, CustomerServiceWeb.Endpoint, server: true
|
|
end
|
|
|
|
if cookie = System.get_env("RELEASE_COOKIE") do
|
|
config :elixir, :cookie, cookie
|
|
end
|
|
|
|
config :customer_service, CustomerServiceWeb.Endpoint,
|
|
http: [port: String.to_integer(System.get_env("PORT", "8080"))]
|
|
|
|
if config_env() == :prod do
|
|
database_url =
|
|
System.get_env("DATABASE_URL") ||
|
|
raise """
|
|
environment variable DATABASE_URL is missing.
|
|
For example: ecto://USER:PASS@HOST/DATABASE
|
|
"""
|
|
|
|
maybe_ipv6 = if System.get_env("ECTO_IPV6") in ~w(true 1), do: [:inet6], else: []
|
|
|
|
config :customer_service, CustomerService.Repo,
|
|
url: database_url,
|
|
pool_size: 1,
|
|
socket_options: maybe_ipv6
|
|
|
|
config :customer_service, CustomerService.EventStore,
|
|
serializer: Commanded.Serialization.JsonSerializer,
|
|
url: database_url,
|
|
pool_size: 1
|
|
|
|
secret_key_base =
|
|
System.get_env("SECRET_KEY_BASE") ||
|
|
raise """
|
|
environment variable SECRET_KEY_BASE is missing.
|
|
You can generate one by calling: mix phx.gen.secret
|
|
"""
|
|
|
|
host = System.get_env("PHX_HOST") || "example.com"
|
|
|
|
config :customer_service, :dns_cluster_query, System.get_env("DNS_CLUSTER_QUERY")
|
|
|
|
config :customer_service, CustomerServiceWeb.Endpoint,
|
|
url: [host: host, port: 80, scheme: "http"],
|
|
http: [
|
|
ip: {0, 0, 0, 0, 0, 0, 0, 0}
|
|
],
|
|
secret_key_base: secret_key_base
|
|
end
|