Hubot无法连接到Rocket Chat?

时间:2016-02-21 18:48:23

标签: hubot rocket.chat

我第一次测试Rocket Chat,我正在关注this guide to Deploy with Docker

我已成功启动Rocket Chat,现在我正在尝试启用Hubot。 我创建了一个名为bot的用户,我使用更新的登录信息修改了文件 docker-compose.yml

这是我的档案:

mongo:
  image: mongo
# volumes:
#    - ./data/runtime/db:/data/db
#    - ./data/dump:/dump
  command: mongod --smallfiles --oplogSize 128

rocketchat:
  image: rocketchat/rocket.chat:latest
# volumes:
#    - ./uploads:/app/uploads
  environment:
    - PORT=3000
    - ROOT_URL=http://localhost:3000
    - MONGO_URL=mongodb://mongo:27017/rocketchat
  links:
    - mongo:mongo
  ports:
    - 3000:3000

# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
  image: rocketchat/hubot-rocketchat
  environment:
    - ROCKETCHAT_URL=localhost:3000
    - LISTEN_ON_ALL_PUBLIC=true
    - ROCKETCHAT_ROOM=''
    - ROCKETCHAT_USER=bot
    - ROCKETCHAT_PASSWORD=hubot
    # - RESPOND_TO_DM=true
    #- ROCKETCHAT_AUTH=password
    - BOT_NAME=bot
# you can add more scripts as you'd like here, they need to be installable by npm
    - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
  links:
    - rocketchat:rocketchat
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
  ports:
    - 3001:8080

我已经使用Hubot启动了容器,但它似乎没有响应Rocket Chat中的命令。 我不确定预期的输出是什么,但似乎他无法连接到localhost:3000,这是我用来打开Rocket Chat的URL。

> docker-compose up hubot   
Recreating rocketchat_mongo_1...
Recreating rocketchat_rocketchat_1...
Recreating rocketchat_hubot_1...
Attaching to rocketchat_hubot_1
hubot_1 | hubot-help@0.1.3 node_modules/hubot-help
hubot_1 | 
hubot_1 | hubot-diagnostics@0.0.1 node_modules/hubot-diagnostics
hubot_1 | 
hubot_1 | hubot-links@0.0.1 node_modules/hubot-links
hubot_1 | 
hubot_1 | hubot-seen@0.2.3 node_modules/hubot-seen
hubot_1 | ├── timeago@0.1.0
hubot_1 | └── coffee-script@1.6.3
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Starting Rocketchat adapter...
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Once connected to rooms I will respond to the name: bot
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Connecting To: localhost:3000

你有什么建议吗?

谢谢!

2 个答案:

答案 0 :(得分:3)

您使用机器中的localhost:3000,但是在hubot容器内部,它应该是您在链接中定义的rocketchat:3000

答案 1 :(得分:1)

不幸的是,你的输出被截断了。

在我的情况下,错误不是连接问题,而是dockerfile正在拉动一个引用1.x版本的rocketchat / hubot-rocketchat图像。 在rocketbot github页面(https://github.com/RocketChat/hubot-rocketchat)上,它声明了

  

请不要使用适配器的v1.x.x.它是实验性的,并且在   期待在核心内进行以绩效为导向的全面变革   还没有发生。

     

请继续使用Hubot Adapter v0.1.x,直至另行通知为止。

所以我将行改为

  image: rocketchat/hubot-rocketchat:v0.1.4 # rocketchat/hubot-rocketchat

和突然发生的火箭聊天机器人正在谈论。