scalableminds / chatroom

React-based Chatroom Component for Rasa Stack
https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/demo.html
GNU Affero General Public License v3.0
307 stars 208 forks source link

Not able to connect to a rasa server with in a docker-compose #133

Closed deleSerna closed 4 years ago

deleSerna commented 4 years ago

HI, I am trying to build a custom chat bot and embedded chatroom.js in a simple html and it worked fine

<head>
  <link rel="stylesheet" href="https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/dist/Chatroom.css" />
</head>
<body>
  <div class="chat-container"></div>

  <script src="https://npm-scalableminds.s3.eu-central-1.amazonaws.com/@scalableminds/chatroom@master/dist/Chatroom.js"/></script>
  <script type="text/javascript">
    var chatroom = new window.Chatroom({
      host: "http://rasa_movie:5005",
      title: "Cinezoek",
      container: document.querySelector(".chat-container"),
      welcomeMessage: "Hi, I am a movie buff. How may I help you?",
      speechRecognition: "en-US",
      voiceLang: "en-US"
    });
    chatroom.openChat();
  </script>
</body>

But when I tried to put it in a docker-compose, it's not connecting to the rasa server. I am not sure where the problem lies. Please see my docker-compose file.

version: '3.0'
services:
 rasa_movie:
   image: myrasa:v3
   ports:
     - 5005:5005
   depends_on:
     - duckling
     - action_server
   command:
     - run
     - -m
     - /app/models
     - --cors
     - "*"
     - --enable-api
     - --log-file
     - out.log
     - -p
     - '5005'
 action_server:
   image: myaction:v1
   ports:
     - "5055:5055"
   command:
     - start
     - --actions
     - actions
  ui_nginx:
    image: mynginx:v2
    ports:
      - "80:80"
 duckling:
   image: rasa/duckling
   ports:
     - "8000:8000"

where mynginx:v2 image is a nginx + the above inde.html in /usr/share/nginx/html.

The error I can see in nginx log is ui_nginx_1 | 2020/07/05 17:13:59 [error] 29#29: *2 open() "/usr/share/nginx/html/apple-touch-icon-precomposed.png" failed (2: No such file or directory), client: 172.223.0.1, server: localhost, request: "GET /apple-touch-icon-precomposed.png HTTP/1.1", host: "localhost" But I do not think it's related to the connectivity to the rasa bot. Could some one advise please

deleSerna commented 4 years ago

I changed host: "http://rasa_movie:5005", to host: "http://localhost:5005" but did not work for me and in the end I tried https://github.com/botfront/rasa-webchat in the same setup and it worked for me.