Access to Postgres database inside Dokku container outside

I find it difficult to find a way to access the Postgres database inside the Dokku contaner (based on docker) from outside the machine using pgAdmin. Is there any way to do this? Do I need to use another client? I expose the database using the command dokku postgres:expose.

+4
source share
1 answer

To connect to pgadmin, you can get all the necessary information from DATABASE_URL.

➜  ~ dokku postgres:info your-database-db
       DSN: postgres://postgres:bf8f1cb443c35cd1ae0a58617ef348cd@dokku-postgres-your-database-db:5432/your_database_db

dokku , , pg. , dokku . , .

[database type]://[username]:[password]@[host]:[port]/[database name]

:

➜  ~ dokku postgres:expose your-database-db
 !     Service is already started
-----> Service your-database-db exposed on port(s) 17825

pg admin , , .

username: postgres
password: bf8f1cb443c35cd1ae0a58617ef348cd
hostname: Your-Dokku-Host-URL (Ex. domain.com or IP of your dokku server)
port: 17825

, dokku AWS EC2, , , TCP "" , .

, .

+15

Source: https://habr.com/ru/post/1624758/


All Articles