运行码头图像时出错

问题描述:

我在执行我创建的图像时遇到了一些问题。该服务需要连接到MongoDB中即使它是由它监听的本地主机:27017运行码头图像时出错

下面

是错误:

INFO 5 --- [localhost:27017] org.mongodb.driver.cluster    : Exception in monitor thread while connecting to server localhost:27017 

[main] org.mongodb.driver.cluster    : No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=MULTIPLE, all=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]}. Waiting for 30000 ms before timing out 
+0

您可以发布您Dockerfile和码头工人,compose.yml如有 –

+0

喜wassim,我评论它是承担。谢谢 –

+0

也许你在两个不同的容器中运行mongo和应用程序,奇怪的是它们都有自己的本地版本 –

春:

概况:督促,默认

数据:

mongodb: 

    database: robotTxt 

    host: localhost 

    repositories: 

    enabled: true 

记录:

图案: 文件: “%d {YYYY-MM-DD HH:MM:SS} [%螺纹]%-5level%记录器36 {} - %MSG%N”

控制台:“%d {YYYY-MM-DD HH:MM:SS} - %MSG%N”

级别:

ROOT:ERROR

org.springframework:ERROR

org.springframework.data:错误

org.mongodb:ERROR

文件:$ {java.io.tmpdir} /application.log

+0

你可以更清楚一点吗?我不明白这是什么。同时检查你的标签。 –