i’m now having trouble connecting to my local post...
# orm-help
i
i’m now having trouble connecting to my local postgres db. i’m trying to use the Postico app on MacOS. the docker container is running but when i try to connect i get an issue that the connection was refused
h
can you share the docker-compose file?
i
sure what’s the best way? pastebin?
h
just paste here
i
version: ‘3’ services: prisma: image: prismagraphql/prisma:1.27 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: postgres user: prisma password: prisma rawAccess: true port: 5432 migrations: true postgres: image: postgres restart: always environment: POSTGRES_USER: prisma POSTGRES_PASSWORD: prisma volumes: - postgres:/var/lib/postgresql/data volumes: postgres:
h
You will require to map the postgres instance to a port
i
i do that in the compose file or somewhere else?
h
yes in docker compose file
let me do that paste the file here
Are you running a existing postgres server in your machine ,then I will mapit to some other port(means not 5432)
i
i’m not sure if i’m running another server
easy way to tell?
these are the only two docker containers i have running at the moment so i’m not sure if that helps
h
lsof -i :5432 Paste the output of this command if you are on a mac
i
lsof: WARNING: can’t stat() apfs file system /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/Marc’s MacBook Pro/2019-02-14-120423/Macintosh HD Output information may be incomplete. assuming “dev=31000004” from mount table
not sure if that is related or not but that’s what i get when i type that command
h
ok its fine
paste this now in docker-compose
Copy code
version: '3'
services:
 prisma:
   image: prismagraphql/prisma:1.27
   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: postgres
           user: prisma
           password: prisma
           rawAccess: true
           port: 5432
           migrations: true
 postgres:
   image: postgres
   restart: always
   ports:
     - '5432:5432'
   environment:
     POSTGRES_USER: prisma
     POSTGRES_PASSWORD: prisma
   volumes:
     - postgres:/var/lib/postgresql/data
volumes:
 postgres:
and restart the container
then you can connect to it on localhost:5432
username and password is prisma
i
yes! thank you so much for your help
on this and the other issue