Docker Community Forums

Share and learn in the Docker community.

Link pact-broker container to postgresql local installation


(Aphexlog) #1

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/ pact_broker/Gemfile pact_broker/Gemfile.lock $APP_HOME
# Update system gems for:
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

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= -e PACT_BROKER_DATABASE_NAME=pactbroker -d -p 80:80 dius/pact-broker