JP
10/18/2018, 5:27 PMprisma is using the postgres-db container as its database. Instead of referencing the database host via an IP address or URL, it simply references the postgres-db image as the database host:
I can connect to my DB using docker exec -it postgres psql -U prisma
, but how do I connect via a GUI like Postico? Postico expects a host like this:
This gives the error "Hostname not found". Can anyone advise if this is possible?Jared
10/18/2018, 5:29 PMJared
10/18/2018, 5:31 PMports:
- "3306:3306"
Jared
10/18/2018, 5:31 PMlocalhost
JP
10/18/2018, 6:19 PMversion: '3'
services:
prisma:
image: prismagraphql/prisma:1.18
restart: always
ports:
- "4466:4466"
environment:
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: postgres
host: localhost
port: 5432
user: prisma
password: prisma
migrations: true
rawAccess: true
postgres:
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
volumes:
- postgres:/var/lib/postgresql/data
volumes:
postgres:
JP
10/18/2018, 6:20 PMprisma_1 | Oct 18, 2018 6:20:03 PM org.postgresql.Driver connect
prisma_1 | SEVERE: Connection error:
prisma_1 | org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Jared
10/18/2018, 6:52 PMcedric
10/19/2018, 12:35 AMlocalhost
to postgres
cedric
10/19/2018, 12:36 AMpostgres
)JP
10/19/2018, 12:51 AMcedric
10/19/2018, 12:52 AMcedric
10/19/2018, 12:52 AMpostgres
hostname only applies when the service is being accessed by other docker containerscedric
10/19/2018, 12:53 AMJP
10/19/2018, 12:54 AMcould not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
cedric
10/19/2018, 12:54 AMcedric
10/19/2018, 12:54 AMcedric
10/19/2018, 12:55 AMports
configJP
10/19/2018, 12:55 AMJP
10/19/2018, 12:57 AMJP
10/19/2018, 1:01 AMcedric
10/19/2018, 1:01 AM:
to be wrapped in quotescedric
10/19/2018, 1:02 AM:
if you don't quote itJP
10/19/2018, 1:03 AMJared
10/19/2018, 2:32 AMcedric
10/19/2018, 2:32 AMJP
10/19/2018, 3:07 AMJared
10/19/2018, 4:22 AM