【发布时间】:2018-06-06 02:02:24
【问题描述】:
我尝试使用他们的试用版在 GAE 上部署我的应用。到目前为止,我成功地使用 python 3.6 创建了一个带有自定义设置的 app.yaml,用于灵活的环境。
但是,在部署应用程序时,应用程序构建成功,但是,我不断收到以下错误
更新服务 [默认](这可能需要几分钟)...失败。 错误:(gcloud.app.deploy)错误响应:[9] 应用程序启动错误: /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
requirements.txt
Flask==0.10.1
gunicorn==19.3.0
twilio==6.8.4
Docker 文件
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" ]
附:在对 requirements.txt 进行更改后,我收到错误 502 Bad Gateway。
显示服务已成功执行的日志。
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 中查看我的代码并告诉我这里缺少什么吗?
【问题讨论】:
-
请您的
Dockerfile和您的requirements.txt! -
请编辑您的问题并将文件内容添加为(代码格式)文本。
-
按照建议进行的更改,我相信我错过了在 dockerfile 中添加 requirements.txt 文件,但我想弄清楚我应该把它放在哪里。
-
我的问题是我拼错了 requirements.txt 文件
标签: python git api google-app-engine flask