can’t reach a postgresql container from an app container

Thanks for providing the source to reproduce the issue. No issues in the docker-compose file as you have already ruled out.

The problem lies between your Dockerfile and the version of node-pg that you are using.

You are using node:14-alpine and pg: 7.18.2. Turns out there is a bug on node 14 and earlier versions of node-pg.

Solution is either downgrade to node v12 or use latest version of node-pg which is currently 8.4.2 (fix went in on v8.0.3).

I have verified both these solutions on the branch you provided and they work.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top