Serve a Bottle application from gunicorn on Heroku

2019-07-16 07:05发布

问题:

Procfile

web: python server.py

server.py

from os import environ
from bottle import app, route, run, static_file

@route('/')
def root():
    return "Hello world!"

if __name__ == '__main__':
    run(server='gunicorn', host='0.0.0.0', port=int(environ.get("PORT", 5000)))

requirements.txt

gunicorn
psycopg2
git+https://github.com/defnull/bottle#egg=bottle

Relevant portion of logfile (after git push)

heroku[router]: at=error code=H14 desc="No web processes running"

回答1:

First of all: Are you certain that those are all of the necessary requirements?

If they are, are you sure you have any dynos allocated? What's the result of heroku ps? H14 is listed as usually being caused by having no dynos set to run your app.

You can set it to use one web dyno with heroku ps:scale web=1.