I was wondering if someone could help me figure this out.
I have a Node application using a Postgres database with PostGIS running inside a docker container. Whenever Prisma tries to connect to it, I get the error P1001: Can't reach database server at localhost:15432
. I can connect to it fine using some database management tools, and I can connect to deployed Postgress database using PostGIS just fine. Below is my docker-compose file and the connection string.
version: '3.8'
services:
postgres:
container_name: test-postgres
image: kartoza/postgis:14-3.3--v2022.08.30
ports:
- 15432:5432
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=test-db
volumes:
- postgis-data:/var/lib/postgresql
volumes:
postgis-data:
DATABASE_URL="postgresql://admin:secret@localhost:15432/test-db?schema=public"
The schema.prisma
file:
generator client {
provider = "prisma-client-js"
previewFeatures = ["interactiveTransactions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}