applying migrations...Error: getaddrinfo ENOTFOUND postgres

Hi Guys , 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
GitHub
Contribute to AyushiitrFreedom/bountpirac development by creating an account on GitHub.
Was this page helpful?