- Add Procfile with the following contents
worker: python your_script.py
- Add requirements.txt file with the format
MODULE_NAME==MODULE_VERSION. Example:
slackclient==1.2.1
Note: Don't add all the requirements using pip freeze as this may create a huge file with so many requirements including conda if you use one, instead pick the ones that are absolutely required
- Push code to heroku and it should be successfully deployed
- Now we need to run the infinitely listening script on a worker instance
heroku ps:scale worker=1
- Check Heroku logs to see outputs such as
Listening on ...using
heroku logs --tail