From b645c7dadec2e99c1b70f56dd04ca66facce1bb7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 26 Mar 2021 11:38:39 +0100 Subject: [PATCH] Allow specifying the listen_ip on Docker Signed-off-by: Thomas Citharel --- config/docker.exs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/docker.exs b/config/docker.exs index 5e7dc5b1a..e84a32995 100644 --- a/config/docker.exs +++ b/config/docker.exs @@ -2,10 +2,21 @@ import Config +listen_ip = System.get_env("MOBILIZON_INSTANCE_LISTEN_IP", "::") + +listen_ip = + case :inet.parse_address(listen_ip) do + {:ok, listen_ip} -> listen_ip + _ -> raise "MOBILIZON_INSTANCE_LISTEN_IP does not match the expected IP format." + end + config :mobilizon, Mobilizon.Web.Endpoint, server: true, url: [host: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.lan")], - http: [port: System.get_env("MOBILIZON_INSTANCE_PORT", "4000")], + http: [ + port: System.get_env("MOBILIZON_INSTANCE_PORT", "4000"), + ip: listen_ip + ], secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis") config :mobilizon, Mobilizon.Web.Auth.Guardian,