mongo,docker和perfectSwift的ipAddressResolutionFailed错误

时间:2018-12-18 04:32:49

标签: swift mongodb docker docker-compose

我收到此错误:

  

致命错误:最高级别出现错误:   MongoSocket.MongoSocket.Error.ipAddressResolutionFailed:文件   /home/buildnode/jenkins/workspace/oss-swift-4.2-package-linux-ubuntu-16_04/swift/stdlib/public/core/ErrorType.swift,   第191行

在构建我的docker-compose时。 docker-compose文件如下所示:

version: '3'
services:
    nginx:
      build: ./docker-nginx-amplify/
      environment:
        - API_KEY=apikey
        - AMPLIFY_IMAGENAME=myapp-Squad
        - mode=production
      ports:
        - "80:80"
        - "443:443"
    myapp-mongo:
      image: mongo:3.2.21
      ports:
        - "57017:27017"
      volumes:
        - ./database/myapp-mongo:/data/db
    myapp-perfect-api:
      build: ./factory-api-perfect-swift/
      ports:
        - "5500:6600"
      links:
        - myapp-mongo

在我的快速应用程序中,与mongodb的连接建立如下:

let myDatabase = try MongoKitten.Database("mongodb://myapp-mongo/taleo")

if myDatabase.server.isConnected {
    print("[SERVER MONGODB] Connected on \(myDatabase.server)")
} else {
    print("[SERVER MONGODB] CONNECTION FAILED !")
}

尽管事实上所有docker-compose命令似乎都已成功执行,但docker-compose ps和docker-compose图像均未显示任何内容。

我在这里做错了什么?

0 个答案:

没有答案