【发布时间】:2021-07-03 14:02:41
【问题描述】:
在 application.properties 中我提供了我的实例的实例详细信息。
每次我尝试运行 docker-compose up 时,都会出现以下错误:
org.postgresql.util.PSQLException: Connection to localhost:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:303) ~[postgresql-42.2.18.jar!/:42.2.18]
我没有在代码、属性或任何其他配置中的任何地方指定 localhost 和端口 5433。
似乎 dockerized 代码无法与 AWS 实例连接,就好像我在没有 docker 的情况下在本地运行这个应用程序一样,它工作得很好。 docker-compose 是否需要任何配置或网络相关设置?
【问题讨论】:
标签: java spring amazon-web-services spring-boot docker