在heroku docker里面运行gunicorn
我有以下procfile:
web: gunicorn application:app --config=gunicorn_config.py
当我运行这个使用foreman start
一切工作正常,但是当我运行这个容器内使用docker-compose up web
,我得到
web_1 | usage: gunicorn [OPTIONS] [APP_MODULE] web_1 | gunicorn: error: No application module specified.
我用来构build容器的过程与Heroku的泊坞窗指南中指定的一样 :
1. `heroku docker:init` to set up Dockerfile and docker compose configuration. 2. `docker-compose build` to create the image. 3. I always do a restart of my vm for good measure: `docker-machine restart default && eval "$(docker-machine env default)"
正如你可以在gunicorn错误信息中看到的那样,你应该在–config选项之后编写app模块。 你也要指定configuration模块(即没有.py),并指定它是python。
=>试试这个:
gunicorn --config python:gunicorn_config application:app