Skip to content

Operation Mode docker

Botium edited this page May 2, 2018 · 1 revision

Capabilities for operation mode "docker"

Those capabilities apply to the "docker" operation mode only. Botium uses Docker Compose to construct a sandbox environment for a Chatbot.

Botium will construct a docker container for a chatbot automatically (DOCKERIMAGE and STARTCMD capability), based on a very generic template. In case the Chatbot doesn't have any special requirements on the docker container, this will work in most projects.

Customizing the docker container

In case the Chatbot has special requirements, it is possible to add a file Dockerfile.botium to the Chatbot source code. If Botium finds this file when constructing the docker container, this file will be used instead.

In case the Chatbot depends on infrastructure components which should be placed in a docker container as well, it is possible to add a file docker-compose.botium.override.yml to the Chatbot source code. If Botium finds this file when constructing the docker environment, this file will be added.

Example: the Chatbot depends on a rethinkdb to work properly. A container for initializing and running rethinkdb will be added to the docker environment.

Finally, in case there are local settings you have to apply to the docker containers, Botium will look for a file named docker-compose.botium.override.yml in the current working directoery and add it to the docker environment as well.

Example: On the local machine, all connections have to pass a HTTP proxy. This can be done by adding environment variables to all docker containers.

This behaviour enables Chatbot developers to construct a customized Sandbox environment to run nearly all flavours of Chatbots. As described in the Botium overview, this docker environment contains mocked endpoints for major Chatbot SDKs for Botium to hook in.

STARTCMD

The command line to start the Chatbot. This command will be run in the Chatbot directory in the docker container. For Chatbots developed in Node.js, this could be "npm start" for example, or "NODE_ENV=dev node index.js".

DOCKERCOMPOSEPATH

Default: "docker-compose"

The path the the Docker Compose executable.

DOCKERMACHINEPATH

Default: "docker-compose"

The path the the Docker Machine executable (only applicable if DOCKERMACHINE capability is true)

DOCKERMACHINE

Default: false

In case the local infrastructure is based on Docker Machine and Docker Toolbox, this option has to be enabled.

DOCKERIMAGE

Default: "node:boron"

The docker image to use for the Chatbot. As Botium itself is developed in Node.js, the default docker image is for Node.js as well.

DOCKERUNIQUECONTAINERNAMES

Default: "false"

Botium names the constructed docker container according to the project name. When running multiple Botium instances in parallel, it can be useful to set this capability to "true" so the container names for parallel sessions won't interfere.

DOCKERSYSLOGPORT and DOCKERSYSLOGPORT_RANGE

Default: DOCKERSYSLOGPORT_RANGE "47100-47299"

Botium collects the console output from the Chatbot docker container with an integrated syslog server. When running multiple Botium instances in parallel, it can be useful to select different tcp port ranges for each session. When using the "DOCKERSYSLOGPORT_RANGE" option, Botium will select the first free tcp port in this range.


The following settings are required for Facebook Chatbots only

FACEBOOK_API

When this capability is "true", Botium will add the mocked Facebook SDK endpoint to the docker environment.

FACEBOOK_WEBHOOK_PORT and FACEBOOK_WEBHOOK_PATH *

Botium needs to know the TCP port and the Facebook Webhook url path of the Chatbot. The hostname will be derived from the docker environment. For a Chatbot developed with Botkit, typical settings are:

  • FACEBOOK_WEBHOOK_PORT: 3000
  • FACEBOOK_WEBHOOK_PATH: "facebook/receive"

FACEBOOK_PUBLISHPORT and FACEBOOK_PUBLISHPORT_RANGE

Default: FACEBOOK_PUBLISHPORT_RANGE "46300-46499"

Botium connects to the mocked endpoint on one of these ports. It could be required to change this if you are running parallel session of Botium.

FACEBOOK_SEND_DELIVERY_CONFIRMATION

Default: "true"

In case the Facebook Chatbot requires a delivery confirmation to work properly, set this capability to "true".


The following settings are required for Slack Chatbots only

SLACK_API

When this capability is "true", Botium will add the mocked Slack SDK endpoint to the docker environment.

SLACK_EVENT_PORT and SLACK_EVENT_PATH *

Botium needs to know the TCP port and the Slack Events url path of the Chatbot. The hostname will be derived from the docker environment. For a Chatbot developed with Botkit, typical settings are:

  • SLACK_EVENT_PORT: 3000
  • SLACK_EVENT_PATH: "slack/receive"

SLACK_OAUTH_PORT and SLACK_OAUTH_PATH *

Botium needs to know the TCP port and the Slack Oauth url path of the Chatbot. The hostname will be derived from the docker environment. For a Chatbot developed with Botkit, typical settings are:

  • SLACK_OAUTH_PORT: 3000
  • SLACK_OAUTH_PATH: "oauth"

SLACK_PUBLISHPORT and SLACK_PUBLISHPORT_RANGE

Default: SLACK_PUBLISHPORT_RANGE "46100-46299"

Botium connects to the mocked endpoint on one of these ports. It could be required to change this if you are running parallel session of Botium.


The following settings are required for Bot Framework Chatbots only

BOTFRAMEWORK_API

When this capability is "true", Botium will add the mocked Bot Framework endpoint to the docker environment.

BOTFRAMEWORK_APP_ID *

BOTFRAMEWORK_CHANNEL_ID

Default: "facebook"

BOTFRAMEWORK_WEBHOOK_PORT and BOTFRAMEWORK_WEBHOOK_PATH *

Default: BOTFRAMEWORK_WEBHOOK_PATH "api/messages" Default: BOTFRAMEWORK_WEBHOOK_PORT "3978"

BOTFRAMEWORK_PUBLISHPORT and BOTFRAMEWORK_PUBLISHPORT_RANGE

Default: BOTFRAMEWORK_PUBLISHPORT_RANGE "46500-46699"

Botium connects to the mocked endpoint on one of these ports. It could be required to change this if you are running parallel session of Botium.