2016-02-21 81 views
2

我測試火箭聊天的第一次,我成功地追蹤this guide to Deploy with DockerHubot無法連接到火箭聊天?

我已經開始火箭聊天,現在我試圖使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容器,但它似乎並沒有給火箭聊天中的命令做出響應。 我不確定預期的輸出是什麼,但似乎他無法連接到localhost:3000這是我用來打開火箭聊天的URL。

> docker-compose up hubot 
Recreating rocketchat_mongo_1... 
Recreating rocketchat_rocketchat_1... 
Recreating rocketchat_hubot_1... 
Attaching to rocketchat_hubot_1 
hubot_1 | [email protected] node_modules/hubot-help 
hubot_1 | 
hubot_1 | [email protected] node_modules/hubot-diagnostics 
hubot_1 | 
hubot_1 | [email protected] node_modules/hubot-links 
hubot_1 | 
hubot_1 | [email protected] node_modules/hubot-seen 
hubot_1 | ├── [email protected] 
hubot_1 | └── [email protected] 
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

您在機器上使用localhost:3000,但是在hubot容器內部形成,它應該按照您在鏈接中定義的rocketchat:3000

+0

感謝您的回答。我做了更改,但我陷入了同一點... hubot_1 | [星期三二月24 2016 19:49:42 GMT + 0000(UTC)]信息連接到:rocketchat:3000 – Muffo

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 

和sudddenly rocketchat機器人在說話。

+1

這是一個很好的解決方案,爲一個不同的錯誤;)我會更新使用docker-compose的文檔。 –

+0

Hi @MarceloSchmidt,文檔是否已更新?只有當我來到這裏時,我才意識到通過docker-compose來運行hubot-rocketchat是可能的/可取的。 (是的,我在這方面很新穎。) – topper

+0

你好,是的,請查看我們在文檔中提到的鏈接:https://raw.githubusercontent.com/RocketChat/Rocket.Chat/develop/docker- compose.yml –