Hi everyone We’re having some trouble running migr...
# orm-help
e
Hi everyone We’re having some trouble running migration script in a docker container. Until now, all the tests have been running in a local docker container. We’re getting the following error:
Copy code
$ docker exec -it main /bin/sh
# npx prisma migrate dev --name init
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "postgres:5432"

Error: P1001

Can't reach database server at `postgres`:`5432`

Please make sure your database server is running at `postgres`:`5432`.
I have made this project as a guide to reproduce the error I’m receiving, the README.md file contains the steps. I’ve also recorded and attached a (terrible 😬) video recording to show in case you don’t wanna run the project I’m running on MBP M1 Max if that would help, but I hope I’m doing something wrong and it’s not environment related thing
1
One more input, TablePlus is able to connect to the
postgres
docker container
Right, I’ve changed the base image from
node:lts-buster-slim
to
node:18
and it worked. My best guess the reason it was failing is because
lts-buster-slim
doesn’t have all the packages required by
prisma
. It would be great if the migration tool team added more logs to help us identify the reason. I’m not sure if I’ll continue sticking to
node:18
on Docker, but I’ll keep this post here as a reference for future reference.
👀 1
n
Thanks for the feedback 🙌 Glad to hear that the problem is resolved. I’ll discuss this with the team so that we can add this in docs so other users don’t run into this.
e
perfect thanks Nurul 🙌