From 38b3f482ecaa78a5c5fd0513c518e5e7e5da8698 Mon Sep 17 00:00:00 2001 From: Luna D Date: Fri, 17 Mar 2023 18:06:21 +0100 Subject: [PATCH] set prod ip via env var --- config/runtime.exs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/runtime.exs b/config/runtime.exs index 883f1345..78bd6fb7 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -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"))