Feathers.js Docker

Feathers.js Docker

我目前正在尝试连接 Docker 和 Feathers.js。我遵循了他们网站上展示的教程:https://docs.feathersjs.com/cookbook/deploy/docker.html#create-an-app

我似乎无法弄清楚为什么我无法在容器外部连接到它。您可以在下面看到容器确实是 运行,但是当我尝试访问任何端点时,我得到的是 "There was an error connecting to http://localhost:3030/users"。您可以在下面的图片中查看我的 Docker 文件(基本上是 Feathers 网站的副本)。最终目标是使用 React、MongoDB 和 FeathersJS 进行设置。 React/Mongo 运行良好,但我无法在 docker 容器内部或通过本地主机注册羽毛,如下所示。

因为 mentioned in this issue a previous version of the CLI was generating applications that are binding to the wrong hostname. Make sure that you are using the latest version of @feathersjs/cli and your src/index.js 没有使用主机名,看起来像这样:

const server = app.listen(port);