I
I
Igor2020-06-14 20:18:55
Node.js
Igor, 2020-06-14 20:18:55

Bundle of Ngrok, Microsoft bot framework, docker-compose?

Colleagues, welcome.

I use Microsoft bot framework
It works great, but if I run it in a container it stops working.
That is, he cannot knock outside.

I get an error something like this
Got error: connect ECONNREFUSED 127.0.0.1:1864

This is how I do it

spoiler

# Development configuration
version: "3.7"

networks:
  api:

services:

  bot:
    container_name: registrator.bot
    restart: on-failure
    image: registrator.bot
    build:
      context: .
      dockerfile: docker/nodejs/dev/Dockerfile
    volumes:
      - .:/app
    networks:
      - api
    ports:
      - 3978:3978
    expose:
      - 3978


Dockerfile
FROM node:alpine

RUN mkdir -p /app

WORKDIR app/

RUN npm install -g npm yo generator-botbuilder
COPY . .
COPY packag*.json ./
RUN npm install

EXPOSE 3978

CMD ["npm", "start-debug"]



I found information on the Internet, they say the problem can be solved with the help of Ngrok.
And yes, the problem really disappeared when Ngrok.exe was explicitly specified in the emulator.

5ee65b7b974c6105990602.png

Attention, the question is, how to configure Ngrok in docker-compose.yml?
So that everything works out of the box without setting up the emulator.

Here is an example how I want
Attention, not a working option

# Development configuration
version: "3.7"

networks:
  api:

services:

  bot:
    container_name: registrator.bot
    restart: on-failure
    image: registrator.bot
    build:
      context: .
      dockerfile: docker/nodejs/dev/Dockerfile
    volumes:
      - .:/app
    networks:
      - api
    ports:
      - 3978:3978
    expose:
      - 3978

  
  ngrok:
    image: registrator.ngrok
    build:
      context: docker/ngrok/dev
      dockerfile: Dockerfile
    ports:
      - "4000:4040"
    command:
      - ngrok http 3978
    depends_on:
      - bot
    networks:
      - api

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question