【发布时间】:2019-06-20 19:03:47
【问题描述】:
我有一个带有 Django 后端和 Angular 前端的项目。我已将它们作为两个服务部署到 Google App Engine Standard 中,并且部署成功。
但是,当我尝试访问后端 url this-backend.appspot.com 时,我得到了
/bin/sh: 1: exec: gunicorn: not found
我的需求文件中有 gunicorn:
gunicorn==19.9.0
我也定义了入口点:
runtime: python37
service: default
entrypoint: gunicorn -b :$PORT thisapp.wsgi
handlers:
- url: /static
static_dir: static
- url: /.*
secure: always
redirect_http_response_code: 301
script: auto
但仍然得到同样的错误。
我在 Stackoverflow 上查看了所有相同的问题,它们要么是因为需求,要么是我定义了它们的入口点。
即使我转到 Stackdriver,我也可以看到 app engine:/ 中的 gunicorn 文件夹:
gunicorn
gunicorn-19.9.0.dist-info
这是后端cloudbuild.yaml文件:
steps:
- name: 'python:3.7'
entrypoint: python3
args: ['-m', 'pip', 'install', '-t', '.', '-r', 'requirements.txt']
- name: 'python:3.7'
entrypoint: python3
args: ['./manage.py', 'collectstatic', '--noinput']
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '--version=prod']
如果有人有任何解决方案或建议,我将不胜感激,因为我在互联网上研究了几乎所有相同的问题。
谢谢,
詹姆斯
【问题讨论】:
标签: django google-app-engine gunicorn google-cloud-build