Fix default listen-ip in Docker configuration

127.0.0.1 will only work in host mode. Default to 0.0.0.0 instead.

It can be manually overritten with actual container IP through
MOBILIZON_INSTANCE_LISTEN_IP env parameter.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-08-19 10:35:51 +02:00
parent 05a551a6e3
commit d2a0c4d044
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -2,7 +2,7 @@
import Config
listen_ip = System.get_env("MOBILIZON_INSTANCE_LISTEN_IP", "127.0.0.1")
listen_ip = System.get_env("MOBILIZON_INSTANCE_LISTEN_IP", "0.0.0.0")
listen_ip =
case listen_ip |> to_charlist() |> :inet.parse_address() do
@ -14,7 +14,7 @@ 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"),
port: String.to_integer(System.get_env("MOBILIZON_INSTANCE_PORT", "4000")),
ip: listen_ip
],
secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis")