I am using pact broker docker image present in
the same image is present in
I am not using docker image of postgresql. I have my own Postgres server hosted in
172.15.16.23 (local ip), port 5432 , admin usaer as pactbrokeruser and password as 'password' and db name is pactbroker-db
.
I am setting environment variable as given in the documentation as
- PACT_BROKER_DATABASE_ADAPTER = postgres
- PACT_BROKER_DATABASE_USERNAME = pactbrokeruser
- PACT_BROKER_DATABASE_PASSWORD = password
- PACT_BROKER_DATABASE_HOST = 172.15.16.23
- PACT_BROKER_DATABASE_NAME = pactbroker-db
I am using docker run command as
docker run --name pactbroker -e
PACT_BROKER_DATABASE_USERNAME=pactbrokeruser -e
PACT_BROKER_DATABASE_PASSWORD=password -e
PACT_BROKER_DATABASE_ADAPTER=postgres -e PACT_BROKER_DATABASE_HOST= 172.15.16.23 -e PACT_BROKER_DATABASE_NAME=pactbroker_db -p 80:80 dius/pact_broker
but still, the connection is not happening.In docker log, I am getting error "connection has not established" Could you please help me writing proper command of connecting dockerized pact-broker to non-dockerized postgresql. ---------------------------after comment from BEth------------------- I have tried as per your suggestion. BUt environment variables are working fine.I have tried by editing docker compose file given in Git Project https://github.com/DiUS/pact_broker-docker as below
version: '2'
services:
broker_app: image: dius/pact-broker ports: - "80:80" environment: PACT_BROKER_DATABASE_USERNAME: postgres PACT_BROKER_DATABASE_PASSWORD: Welcome123 PACT_BROKER_DATABASE_HOST: 10.0.0.204 PACT_BROKER_DATABASE_NAME: postgres
I have removed database image downloading part as I am using it externally. I have given my external Postgres data base details in the imageenter image description here
So as host I am giving the ip of the server, is it correct?