Error: connect ECONNREFUSED 127.0.0.1:5432

Depending on how your service is actualy named in the compose file, it is almost or completly correct.

  • if your service is named “dabase” then its correct.
  • if your service is named “database”, then your environment must be spring.datasource.url=jdbc:postgresql://database:5432/reactdb (of course if reactdb is also correct)