I am using nextjs app router with drizzle with postgres and its working fine in development mode but when i am running it with docker compose up –build its giving me this error
[⣷] applying migrations...Error: getaddrinfo ENOTFOUND postgres
1.013 at /app/node_modules/pg-pool/index.js:45:11
1.013 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1.013 at PgDialect.migrate (/app/node_modules/src/pg-core/dialect.ts:72:3)
1.013 at migrate (/app/node_modules/src/node-postgres/migrator.ts:10:2) {
1.013 errno: -3008,
1.013 code: 'ENOTFOUND',
1.013 syscall: 'getaddrinfo',
1.013 hostname: 'postgres'
1.013 }
the whole code can be found in this repo https://github.com/AyushiitrFreedom/bountpirac
I tried running the containers saperately to see if the error was due to postgress container not getting started correctly , i tried chaning the postgres driver , Postgresjs to node-postgress(pg client) , It runs locally by the way fine.
AYUSH GOYAL 22110009 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.