我试图使用他们的试用版在GAE上部署我的应用程序。到目前为止,我已经成功地用python 3.6创建了一个app.yaml,它具有灵活环境的自定义设置。
但是,在部署应用程序时,该应用程序会成功生成,但是,我一直收到以下错误
Updating service [default] (this may take several minutes)...failed. ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error: /bin/sh: 1: exec: gunicorn: not found
以下是我的项目中文件的文件夹层次结构:
遵循app.yaml的代码
env: flex
runtime: custom
api_version: 1
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 3.6
#handlers:
#- url: /SmsResponse
# script: Twilio_Routing.RecivedSms
#
#- url: /CallResponse
# script: Twilio_Routing.ReceivedCall
我肯定错过了一些事情,我真的很感激这里的帮助。 Link to git repo
需求.txt
Flask==0.10.1
gunicorn==19.3.0
twilio==6.8.4
停靠文件
FROM gcr.io/google-appengine/python
LABEL python_version=python3.6
RUN virtualenv --no-download /env -p python3.6
# Set virtualenv environment variables. This is equivalent to running
# source /env/bin/activate
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
# Copy the application's requirements.txt and run pip to install all
# dependencies into the virtualenv.
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt
ADD . /app/
#CMD gunicorn -b :$PORT main:app
ENTRYPOINT [ "python", "Twilio_Routing.py" ]
p.S.更改requirements.txt之后,我得到错误502坏网关。
显示服务已成功执行的日志。
017-12-25 01:29:03 default[20171224t212610] * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
2017-12-25 01:29:03 default[20171224t212610] * Restarting with stat
2017-12-25 01:29:03 default[20171224t212610] * Debugger is active!
2017-12-25 01:29:03 default[20171224t212610] * Debugger PIN: 134-103-452
2017-12-25 01:29:17 default[20171224t212610] * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
2017-12-25 01:29:17 default[20171224t212610] * Restarting with stat
2017-12-25 01:29:17 default[20171224t212610] * Debugger is active!
2017-12-25 01:29:17 default[20171224t212610] * Debugger PIN: 134-103-452
有人能看看我在git中的代码并告诉我这里缺少什么吗?
考虑到^{} 页面中显示的示例,请考虑将您的命令行更改为:
致:
我只看到^{} used here 当基图像是
python
时,而不是gcr.io/google-appengine/python
。对我来说,错误很简单,只要确定gunicorn在
requirements.txt
注意:
我看到OP添加了这个标志;这是为了帮助可能遇到
exec: gunicorn: not found
的其他人做了一些修改,我就可以在docker中运行你的应用了。
Twilio_Routing.py
中,将host
更改为监听0.0.0.0
,而不是127.0.0.1
。这也需要使服务器在外部可用。由于您的
app.yaml
已配置,因此不需要按照Google App Engine
的要求自定义Dockerfile
。保留为您自己的自定义设置。以下是我使用的设置:相关问题 更多 >
编程相关推荐