SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:4321 SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:4321 docker docker

SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:4321


your app container and postgres are running in two different containers that's mean that they are two different machines each machine has it's own ip.

you can't call postgres service from your app container by using localhost:postgresport and vice verse , from postgres to app container

it seems that the Constants.database.host is localhost or 172.0.0.1 , to reach postgres container you have to call container ip or name or service name

in your case change Constants.database.host value to be postgres and give it a try