Link pact-broker container to postgresql local installation

my dockerfile is as follows:

FROM phusion/passenger-ruby24:0.9.26

ENV APP_HOME=/home/app/pact_broker/
RUN rm -f /etc/service/nginx/down /etc/nginx/sites-enabled/default
COPY container /
RUN gem update --system
# USER app

COPY pact_broker/config.ru pact_broker/Gemfile pact_broker/Gemfile.lock $APP_HOME
# Update system gems for:
# https://www.ruby-lang.org/en/news/2017/08/29/multiple-vulnerabilities-in-rubygems/
RUN gem install bundler && \
    cd $APP_HOME && bundle install --deployment --without='development test'
COPY pact_broker/ $APP_HOME/
RUN chown -R app:app $APP_HOME

EXPOSE 80
CMD ["/sbin/my_init"]

I need to make this docker container speak to my local postgresql installation on the host…

What would I need to add to this file in order to make this happen?

my run command is as follows:
docker run --name pactbroker --link pactbroker-db:postgres -e PACT_BROKER_DATABASE_USERNAME=pactbroker -e PACT_BROKER_DATABASE_PASSWORD=pactbroker -e PACT_BROKER_DATABASE_HOST=127.0.0.1 -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact-broker

In case of MAC OS -

By default Postgres works on localhost and if you haven’t done any changes with that then it must be localhost.

Our case is to connect Postgres with our container of pact-broker means a container will interact with our local.

So instead of “localhost” define your host as “docker.for.mac.localhost”, It should work.

Note: if you are on diff OS other then MAC and their must be something like “docker.for.win.localhost” for windows