我很难理解将机器人框架模拟器连接到在本地码头容器中运行的机器人的过程。
我在机器人框架作曲家的帮助下创建了一个(nodejs)机器人。我可以使用bot框架模拟器成功启动机器人,并成功地连接到它:
-
- 验证bot frame emulator中的chatbot connect
接下来,我将应用程序放入一个应用程序Docker Container,暴露了端口3978,并再次在本地开始。我可以成功验证,容器正在运行
- 验证在cli上验证运行docker容器
我还可以验证,bot应用程序在容器中运行,并且可以通过调用端点 localhost:3978/api/messages 在我的浏览器中访问。
对我来说,该机器人似乎在Docker容器中运行,因为有一个陈述,即路由不存在(可以理解,因为未实现获取API/消息)
- 验证docker容器中的bot是否在docker
容器中运行然后,我在bot框架模拟器中创建了一个新的端点配置:
- 添加端点配置到dockerized chatbot
现在出现问题:如果我打开端点连接,i i,i收到500个错误(连接拒绝)。
- 验证bot框架模拟器输出
有人有想法吗?
有什么区别:
- 使用“ npm Run dev”启动机器人(= bot可在http:// localhost:3978/api/messages),并
- 使用Docker容器启动机器人(= bot,请访问http://可用Localhost:3978/API/消息)
我在GitHub上发现以下问题,但这无济于事:
https://github.com/microsoft/botframework-botframework-emulator-emulator-emulator-emulator/sissues/sissues/356
看来,这里的用户比我较远,因为我的设置在连接时间已经失败了,在GitHub问题中,用户在已经连接的机器人的情况下遇到了“发送”消息的问题。
在此先感谢您的任何指导!
I've trouble to understand the process to connect the Bot Framework Emulator to a bot, that runs within a local Docker container.
I created a (NodeJS) bot with the help of the Bot Framework Composer. I can start the bot with the IDE and connect to it via the Bot Framework Emulator successfully:
- Start chatbot via Bot Framework Composer
- Verify chatbot connect in Bot Framework Emulator
Next, I put the application into a Docker Container, exposed the port 3978 and started it locally again. I can successfully verify, that the container is running
- Verify running Docker Container on CLI
I can additionally verify, that the bot application is running in the container and that is accessible by calling the endpoint localhost:3978/api/messages in my browser.
For me it seems, that the bot is running in the Docker container, because there is a statement, that a route does not exist (understandable, because GET api/messages is not implemented)
- Verify if bot is running within the Docker container
I then created a new endpoint configuration in Bot Framework Emulator to connect to my locally deployed bot in the Docker container:
- Add endpoint configuration to dockerized chatbot
Now the issue appears: If I open the endpoint connection, I receive a 500 error (connection refused).
- Verify Bot Framework emulator output
Does someone have an idea, what's actually going on here?
What's the difference between:
- starting the bot with "npm run dev" (= bot is available at http://localhost:3978/api/messages) and
- starting the bot with a Docker container (= bot is available at http://localhost:3978/api/messages)
I found following issue on GitHub, but this didn't help:
https://github.com/microsoft/BotFramework-Emulator/issues/356
It seems that the user here was one step further than me, because my setup already fails during connection time and in the GitHub issue the user had issues "sending" messages to a already connected bot.
Thanks in advance for any guidance here!
发布评论
评论(3)
这是一个古老的问题,但是我也有同样的问题。如果可以帮助某人,这就是我修复它的方法:
在您的
docker-compose.yml
config,您需要将运行机器人在容器内运行的端口曝光到本地主机,以便bot框架模拟器可以与之交谈,然后您还需要让您的机器人查看Localhost上的内容,以响应Bot Framework仿真器。以下行允许您连接到
http(s):// localhosthost上运行的事物:(port)
通过调用http(s)://host.docker.internal:(端口)
从您的容器内部。 请参阅文档设置:
本地
http:// localhost:3978/api/messages
This is an old question, but I had the same problem. Here is how I fixed it if that can help someone:
In your
docker-compose.yml
config, you need to expose the port running your bot inside your container to your localhost, so that the Bot Framework Emulator can talk to itThen you also need to let your bot see what's running on localhost, to respond to the Bot Framework Emulator. The following line lets you connect to things running on your
http(s)://localhosthost:(port)
by callinghttp(s)://host.docker.internal:(port)
from within your container. See documentationFinally, in your Bot Framework Emulator settings:
Bypass ngrok for local addresses
host.docker.internal
You should then be able to connect to
Open Bot
http://localhost:3978/api/messages
什么帮助我。
docker构成设置
端口:
:
用于测试我使用bot框架模拟器
What help me.
Docker Compose settings
ports:
extra_hosts:
For test I use Bot Framework Emulator
为@yannickv答案提供投票。我只是在此处发布一个真实示例:
服务:
Botservice:
图像: /echobot
端口:
- “ 8080:8080”
extra_host:
- “ host.docker.internal:host-gateway”#这个值是重要的
然后您可以在本地调试
Upvote for @yannickv answer. I just post a real example here:
services:
BotService:
image: /echobot
ports:
- "8080:8080"
extra_hosts:
- "host.docker.internal:host-gateway" # this value is important
Then you can debug locally