How to connect to the Portal internal Postgresql database using admin console on a remote machine

book

Article ID: 102941

calendar_today

Updated On:

Products

CA API Developer Portal CA API Gateway

Issue/Introduction



How can I  map the 5432 port that Postgress database docker container is using so it can be accessed remotely and use admin tool such as PgAdmin to connect.

Environment

Release:
Component: APIPRD

Resolution

By default the port 5432 to is only available to the Docker host itself and  you are not be able to reach the internal port on the Docker portaldb container.
from a remote machine,you can  make docker publish the port for the outside world by running :
 
docker service update --publish-add "5432:5432" portal_portaldb --detach=false
 
This will add the port 5432 from the docker portaldb container a public port 5432 on the local docker service. 
After that you are can connect to the Postgress database from a remote box using PgAdmin. on port 5432