-
I deployed misskey using docker. But I get the error when I try to manage the database with pgAdmin. It can't connect the database server. After i check the docker processes I found that the pgsql container has no open ports for pgAdmin to connect.
How to make the pgAdmin connect to the local database? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There are 2 ways to do it.
For option one you would do something like the following and and connect to it from pgadmin using "localhost:5432" db:
restart: always
image: postgres:12.2-alpine
networks:
- internal_network
+ - external_network
+ ports:
+ - "5432:5432"
env_file:
- .config/docker.env
volumes:
- ./db:/var/lib/postgresql/data For option 2, you will have to add a new section like pdadmin:
image: dpage/pgadmin4
networks:
- internal_network
- external_network
ports:
- "8080:80" # to expose the pgadmin to your local machine
env:
- PGADMIN_DEFAULT_EMAIL=<your-email>
- PGADMIN_DEFFAULT_PASSWORD=<you_password>
links:
- db Then you can open pg admin from "localhost:8080" and connect to the DB from pgadmin using "db:5432". |
Beta Was this translation helpful? Give feedback.
There are 2 ways to do it.
ports
mapping to the Postgres service ondocker-compose.yml
and open the port to the host and connect from the hostdocker-compose.yml
and link it to the postgres container.For option one you would do something like the following and and connect to it from pgadmin using "localhost:5432"
For option 2, you will have to add a new section like