How you would configure elixir app with ecto to connect with postgres on host machine?

I’ve find another way of solving this problem.

Uncommented this line from config/config.exs

import_config "#{config_env()}.exs"

Added docker.exs with

import Config


config :echo, Echo.Repo,
  database: "echo_db",
  username: "postgres",
  password: "postgres",
  hostname: "host.docker.internal"

Added to up of Dockerfile

ENV MIX_ENV docker