I am using Taipy and I need to deploy my app on Heroku. I keep getting error "Web process failed to bind to $PORT within 60 seconds of launch". Here is an image of the log file below.

my Procfile
web: python main.py --host=0.0.0.0
echo ${GOOGLE_CREDENTIALS} > /app/google-credentials.json
I have included the main.py script. The last line of the script contains the rn function which is used to run the taipy server on default port 5000. I don't know how to adjust the run() function to accept heroku default port.
**Edit: main.py **
. . .
if __name__ == "__main__":
Core().run()
scenario = tp.create_scenario(scenario_cfg)
scenario_search = tp.create_scenario(text_search_scenario_cfg)
scenario_search_image = tp.create_scenario(image_search_scenario_cfg)
Gui(pages = pages).run()
If you want to handle web requests on Heroku, your service needs to listen on the right port. This is provided at runtime via the
PORTenvironment variable:This can be done in
main.py, but the easiest solution is probably to add the--portoption to thewebprocess in yourProcfile:Note that the second line in your
Procfilewon't do anything.Procfiles aren't scripts, so you can't run arbitrary commands like that. They define process types.If you can set your credentials some other way (e.g. read them directly from the environment variable instead of dumping that variable to a file and reading the file), I suggest you do that. If you really need that file to exist, you may want to consider writing a wrapper shell script to create the file and start your application.