0

有没有办法在不使用 ngrok(我正在使用 traefik)的情况下将带有 docker 的 rasa 服务器公开给 slack,我将它公开给“ https://rasa.dev.x-hub.io ”所以当我尝试时: https:// rasa.dev.x-hub.io/webhooks/slack/webhook 我没有得到回应。正如您在下面看到的,一切正常。

拉萨服务器:

忽略张量流错误在此处输入图像描述

动作服务器:

在此处输入图像描述

小鸭:

在此处输入图像描述

以下是 docker-compose 文件:

version: "2"
services:
  rasa:
    image: registry.gitlab.com/xhub-org/p/xpeers/slackbot:{{img_version}}
    container_name: rasa
    labels:
      - traefik.frontend.rule=Host:rasa.dev.x-hub.io
      - traefik.port={{app_port}}
      - traefik.docker.network=web
      - traefik.enable=true
    restart: always
    networks: ['rasa-network']
    command:
      - run
      - --cors
      - "*"
      - --enable-api
      - --log-file
      - out.log
      - --connector
      - slack
      - --credentials
      - slack_credentials.yml
      - --endpoints
      - endpoints.yml
      - -m
      - /models
    depends_on:
      - action_server

  action_server:  
    image: registry.gitlab.com/xhub-org/p/xpeers/slackbot:{{img_version}}
    container_name: rasa_action_1
    networks: ['rasa-network']
    command :
      - run
      - actions

  duckling:
    image: rasa/duckling:latest
    networks: ['rasa-network']
    ports:
      - "8005:8005"

networks: {rasa-network: {}}

我还使用集成到 GitLab 中的 Docker Container Registry,每个项目都可以有自己的空间来存储其 Docker 映像。

请提供任何帮助!

4

1 回答 1

0

通过添加解决了我的问题:

networks:
  - web
  - rasa-network

和 :

networks:
  rasa-network:
  web:
    external: true

完整更新:

version: "2"
services:
  rasa:
    image: registry.gitlab.com/xhub-org/p/xpeers/slackbot:{{img_version}}
    container_name: rasa
    labels:
      - traefik.frontend.rule=Host:rasa.dev.x-hub.io
      - traefik.port={{services.rasa.app_port}}
      - traefik.docker.network=web
      - traefik.enable=true
    restart: always
    networks:
      - web
      - rasa-network
    command:
      - run
      - --cors
      - "*"
      - --enable-api
      - --log-file
      - out.log
      - --connector
      - slack
      - --credentials
      - slack_credentials.yml
      - --endpoints
      - endpoints.yml
      - -m
      - /models
    ports:
      - "5005:5005"
    depends_on:
      - action_server

  action_server:  
    image: registry.gitlab.com/xhub-org/p/xpeers/slackbot:{{img_version}}
    container_name: rasa_action_1
    networks:
      - rasa-network
    command :
      - run
      - actions
    ports:
      - "5055:5055"

  duckling:
    image: rasa/duckling:latest
    networks: ['rasa-network']
    ports:
      - "8005:8005"

networks:
  rasa-network:
  web:
    external: true
于 2020-01-08T15:55:11.057 回答