swift - 无法在 gCloud 中部署 Swift Vapor 应用程序

标签 swift google-app-engine gcloud vapor server-side-swift

我有一个在本地运行良好的 Swift Vapor 应用程序。我已经使用 Postman 测试了端点。

当我尝试将应用部署到 Google Cloud 时,出现以下错误。

ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error: Fatal error: Error raised at top level:

NIO.ChannelError.connectFailed(NIO.NIOConnectionError(host: "localhost", port: 5432, dnsAError: nil, dnsAAAAError: nil, connectionErrors: [NIO.SingleConnectionFailure(target: [IPv6]localhost/::1:5432, error: connect(descriptor:addr:size:) failed: Cannot assign requested address (errno: 99)), NIO.SingleConnectionFailure(target: [IPv4]localhost/127.0.0.1:5432, error: connection reset (error set): Connection refused (errno: 111))])): file /home/buildnode/jenkins/workspace/oss-swift-5.0-package-linux-ubuntu-14_04/swift/stdlib/public/core/ErrorType.swift, line 200

我不知道我错过了什么。这是我的码头文件。

FROM ibmcom/swift-ubuntu:latest

LABEL Description="App (swift) running on Docker" Vendor="Imthath" Version="1.0"


# Expose default port for App Engine
EXPOSE 7070

# Add app source
ADD . /app
WORKDIR /app

# Build release
RUN swift build --configuration release

ENTRYPOINT .build/release/Run

这是我的 app.yaml。

runtime: custom
env: flex

我在这里错过了什么?一些只有错误的谷歌搜索表明 Postgres 可能丢失了。我在我的应用程序中使用 FluentPostgreSQL。在那种情况下,如何在我的容器中安装 postgres?或者我还应该做什么?

最佳答案

您正在为您的数据库连接或您尝试连接的任何内容指定本地主机。它打印在错误消息中。

关于swift - 无法在 gCloud 中部署 Swift Vapor 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56548963/

相关文章:

php - 使用 Google API 客户端生成器生成 Cloud Endpoints PHP 客户端时出现空目录

authentication - 启用对非公共(public) Google Cloud Function 的 token 访问

go - 在Google Cloud上部署服务器二进制文件

ios - 在 Swift 2.3 中关闭 UIAlertController 键盘

iOS 多云 UIViewController 背景

ios - UIStackView 内的 UISegmentedControl,分段文本不居中 - iOS 13

ios - 当我删除包含核心数据的单元格时,同一单元格显示两次

java - GAE+Java : Hook textbox to input, div 输出

node.js - 查询 Google Cloud Datastore 以检索匹配结果

google-cloud-platform - gcloud 403 权限错误,项目错误