set prod ip via env var

This commit is contained in:
Luna D 2023-03-17 18:06:21 +01:00
parent 8c7f633b18
commit 38b3f482ec
No known key found for this signature in database
GPG key ID: 4B1C63448394F688

View file

@ -120,8 +120,10 @@ if config_env() == :prod do
auth: :always
# Production endpoint config
{:ok, ip} = :inet.parse_address(System.get_env("APP_IP", "127.0.0.1") |> String.to_charlist())
config :philomena, PhilomenaWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: {:system, "PORT"}],
http: [ip: ip, port: {:system, "PORT"}],
url: [host: System.fetch_env!("APP_HOSTNAME"), scheme: "https", port: 443],
secret_key_base: System.fetch_env!("SECRET_KEY_BASE"),
server: not is_nil(System.get_env("START_ENDPOINT"))