IBM-Cloud / get-started-python

A Python application and tutorial that use Flask framework to provide a REST API to receive requests from the UI. The API then persists the data to a Cloudant database.
https://console.ng.bluemix.net/docs/runtimes/python/getting-started.html
Apache License 2.0
121 stars 445 forks source link

Procfile changes, example not running properly on CF App #16

Closed cbrgm closed 6 years ago

cbrgm commented 6 years ago

Hi there!

First of all, thank you for taking the trouble to provide this example! Unfortunately, I had some difficulties with the deployment. After following the steps in the tutorial, it was not possible to deploy the app in Cloud Foundry. Everything works great locally, but once the project is pushed into the cloud, Cloud Foundry ignores any host and port parameters.

After a long search I found the solution and was able to deploy the app successfully. In the procfile the start parameter had to be adjusted and Python flask had to be informed via -h and -p flag about the corresponding settings of the host and port. Also, an environment variable had to be set in the Cloud Foundry app (FLASK_APP), without which Flask could not find and start the webservice.

I have adapted the procfile and README.md of the example here so that it can be executed correctly locally and remotely.

rvennam commented 6 years ago

Hi @cbrgm I just tested the master branch and I was able to push to IBM Cloud as a Cloud Foundry application without any problems.

https://github.com/IBM-Bluemix/get-started-python
cd get-started-python
bx cf push rvennam-python-th