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:
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
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)
I then created a new endpoint configuration in Bot Framework Emulator to connect to my locally deployed bot in the Docker container:
Now the issue appears: If I open the endpoint connection, I receive a 500 error (connection refused).
Does someone have an idea, what's actually going on here?
What's the difference between:
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!
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 it
ports:
- "3978:3978"
Then 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 calling http(s)://host.docker.internal:(port)
from within your container. See documentation
extra_hosts:
- "host.docker.internal:host-gateway"
Finally, 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