You can define multiple workers in your Procfile.
https://devcenter.heroku.com/articles/procfile#more-process-type-examples
web: python main.py
app: npm start
However bear in mind an app can only have one active web worker. The flask app will probably use a port. And your node application will likely as well. In my example the app
worker cannot open a port! If that is the case you need to host your repo on 2 separate Heroku Apps (change app
to web
in that case)
In order to mix Python (Flask) and Node you will need to install multiple buildpacks. You can let Heroku automatically detect them with requirements.txt
, runtime.txt
and package.json
but it is not reliable.
This is why you should define your used buildpacks in a app.json
https://devcenter.heroku.com/articles/app-json-schema#buildpacks
{
"buildpacks": [
{
"url": "https://github.com/heroku/heroku-buildpack-nodejs"
},
{
"url": "https://github.com/heroku/heroku-buildpack-python"
}
]
}