Here is a ready to use JAICF bot template that can be ran locally or deployed to JAICP Cloud or Heroku server.
Please refer to the detailed Quick Start that shows how to use this template with JAICP and CAILA NLU services.
Deploy to Heroku
If you would like to deploy this project to the Heroku cloud, just click on the button below
- After deployment open the app and copy the URL of the app to clipboard.
- Then go to JAICP Web Interface, open your project's settings, select webhook type of connection and paste your URL.
- That's it! Now all the channels will communicate through your bot deployed to Heroku.
You can switch project back to long polling instead of webhook once you need to route all messages to your local machine during development.
To build and run Docker image:
- Build project with
stage
gradle task - Build Docker image with
docker build -t jaicf-jaicp-caila-template .
- Run Docker image with
docker run -p 8080:8080 -e JAICP_API_TOKEN=<your JAICP project token> jaicf-jaicp-caila-template
Note that this builds a webhook version of your JAICF bot. Thus, you have to propagate your local 8080 port to the global web (through some gateway like ngrok) and configure your JAICP project with direct public URL of your machine.
To pass java options to your Docker image just run it with JAVA_TOOL_OPTIONS environment like:
docker run -p 8080:8080 -e JAICP_API_TOKEN=<your JAICP project token> -e "JAVA_TOOL_OPTIONS=-Xms1024m -Xmx2048m" jaicf-jaicp-caila-template