I have been trying to deploy a bot on heroku for days now without success. My bot has an action server hosted on another app. The main bot contains a Dockerfile with the content below:
# from rasa base image
FROM rasa/rasa:2.8.2-full
# copy all source and the Rasa generated model
COPY . /app
# inform which port will run on
EXPOSE 5005
# script to run rasa core
COPY startup.sh /app/scripts/startup.sh
# script to run rasa shell
COPY shell.sh /app/scripts/shell.sh
USER root
RUN chmod a+x /app/scripts/startup.sh
RUN chmod a+x /app/scripts/shell.sh
WORKDIR /app
ENTRYPOINT []
ENV shell_mode false
# launch script (rasa shell or rasa run)
CMD sh -c 'if [ "$shell_mode" = false ]; then /app/scripts/startup.sh; else /app/scripts/shell.sh; fi'
After pushing this container on heroku, I keep getting the following log:
2021-08-08T05:05:19.003044+00:00 heroku[web.1]: Starting process with command `/bin/bash -o pipefail -c sh\ -c\ \'if\ \[\ \"\false\"\ \=\ false\ \]\;\ then\ /app/scripts/startup.sh\;\ else\ \ /app/scripts/shell.sh\;\ fi\'`
2021-08-08T05:05:22.624829+00:00 app[web.1]: PORT 56161
2021-08-08T05:05:28.172219+00:00 app[web.1]: 2021-08-08 05:05:28 INFO root - Starting Rasa server on http://localhost:56161
2021-08-08T05:05:28.198725+00:00 app[web.1]: 2021-08-08 05:05:28 INFO rasa.model - Loading model models/20210807-142446.tar.gz...
2021-08-08T05:06:19.182952+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2021-08-08T05:06:19.237369+00:00 heroku[web.1]: Stopping process with SIGKILL
2021-08-08T05:06:19.401953+00:00 heroku[web.1]: Process exited with status 137
2021-08-08T05:06:19.707060+00:00 heroku[web.1]: State changed from starting to crashed
My startup.sh
contains:
echo PORT $PORT
rasa run -m models --endpoints heroku-endpoints.yml --cors "*" --enable-api -p $PORT
What am I doing wrong? Kindly help.