I am trying to deploy my bot on heroku using a docker. When I release
Since Heroku dynamically generates the port number for the app, I used the $PORT variable. The problem is for some reason, the port number generated comes with a preceding backslash and this caused the app to fail. Any ideas on how I can fix this??
One thing that you will need to take note of is that in the dockerfile… coz of the issue that I mentioned above you will need to change the CMD command. Below is an example of a dockerfile that I used to run the action server at one time
#Make sure that the directory has the init.py and action.py files
FROM rasa/rasa:latest-full
WORKDIR /app
ADD . .
ENTRYPOINT []
EXPOSE 5005
CMD $(echo "rasa run actions -p $PORT --debug" | sed 's/=//')
Hi Simba.
I’m totally new in this field.
Can you show me all your root file and dockerfile? and what type of <process-type> should I use in this command
heroku container:push <process-type>
I’m confused between your dockerfile in the first comment and the last one you reply me. I use Rasa Open Source (not Rasa X) and my folder just like this
data
models
_init_.py
actions.py
config.yml
credentials.yml
domain.yml
endpoints.yml
requirements.txt
I am happy to help but i think its worth taking a few steps back to look at the bigger picture. Tell me… why is it u want to run yo bot on heroku… reason why i am asking is… after playing around with it for quite a bit… i gathered its not the best of platforms to run your bot from. In fact, from the sound of it… it seems you already have a basic bot that provides some of your key responses (also known as happy paths) you would rather look for another cloud service provider and set yo bot up and run it from there.
Check out this Rasa Master Class, it will walk you through what u need to do to have it up and running step by step.
Thank you. I have built a simple bot and used ngrok to make it available for everyone who visit my website (to complete my thesis in school). But I can’t always use ngrok. (turn on my computer). So I want to deploy my bot to a cloud server. I think heroku is a good choice.
I have deployed it follow your help but I got some errors in CMD command. This is my dockerfile
FROM rasa/rasa:latest-full
ENV PORT 5005
WORKDIR /app COPY ./ ./
EXPOSE 5005
CMD $(echo “rasa run -p $PORT -m models --credentials credentials.yml --enable-api --log-file out.log --endpoints endpoints.yml” | sed ‘s/=//’)
Oh… glad to hear you already deployed the action server successfully. It means you are almost there… Can you please share the error that you are having with the CMD
Hi @cityhunter25197,
Did you find a solution? Also looking into deploying my rasa chatbot to heroku server, but not sure where to start actually. It is also a bit confusing as it is sometime not clear whether the info is about how to deploy with Rasa Open Source or Rasa X… So really would like to know the steps you undertook (also for the deployment of your actions!)
Many thanks!
Apologies on responding on this very late. As they say… better late than never
I still have my reservations on using heroku for this but I have seen that there are a number of people exploring this route so here are some steps that can help you
Steps to create bot using docker and deploy on heroku
Create a docker image using a docker file with the text below and the command: docker build -t chat_bot:v1 .
FROM rasa/rasa:1.10.3-full
USER root
RUN apt-get update -qq
WORKDIR /app
ADD . .
ENTRYPOINT []
USER 1001
CMD $(echo “rasa run -p $PORT -m models --credentials credentials.yml --enable-api --log-file out.log --endpoints endpoints.yml” | sed ‘s/=//’)
Create a project using the new image using the command:
docker run -v /c/Temp/bot:/app chat_bot:v1 rasa init --no-prompt
At this point you can make changes to your bot (add stories\intents etc) and to run and train the bot after making the changes you can train the bot using the command:
docker run -v /c/Temp/bot:/app chat_bot:v1 rasa train --domain domain.yml --data data --out models
To see your bot in action, you use the command:
docker run -it -v /c/Temp/bot:/app chat_bot:v1 rasa shell
Now lets deploy to heroku. Assuming you already have a heroku acc and the cli installed)
a. heroku login
b. heroku container:login
c. heroku create
* this creates the app that will be used by the docker
d. heroku container:push web --app xxxxxxxxx
* xxxxxxxxx is the name of the heroku app that was created in step c
e. heroku container:release web --app xxxxxxxxx
* this is what starts the heroku app
f. heroku logs --tail --app xxxxxxxxx
* run this to confirm that the bot is up and running.