Albert Sugianto
Albert Sugianto

Reputation: 33

Succeeded in Deploying Flask app at Azure, but app does not work upon opening website

I have a problem with deploying my flask application to azure. I am currently deploying it through github, and deployed successfully. But upon opening the website, it gives me errors. Mainly this (looked on Application logs):

 2019-11-15T02:22:03.098959319Z /opt/startup/startup.sh: 23:
  /opt/startup/startup.sh: gunicorn --bind=0.0.0.0 --timeout: not found

and this:

Container goodnewsviagithub_0_a04a1362 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.

My entry point is gunicorn --bind=0.0.0.0 --timeout 600 run:app

: And my code is

Is this because of my flask structure?

Any help would be great! I am really stuck on this.

Thank you very much again! Hope you all have a great day.

Upvotes: 1

Views: 1945

Answers (1)

Albert Sugianto
Albert Sugianto

Reputation: 33

Soo it turns out to be the shebang in python that linux needs to identify the py file

#!/usr/bin/env python3 
# ^ is the shebang, not a comment 

from flaskapp import app

if __name__ == '__main__':
    app.run(host='0.0.0.0',port="8400",debug=True)
    #app.run(host='172.17.0.1',port="3306",debug=True)


Upvotes: 0

Related Questions