为什么manage.py文件没有在App Engine灵活的dockerfile中执行?

Joh*_*ohn 5 django google-cloud-platform

因此,App Engine 用于为 Django 应用程序生成容器的 dockerfile 如下:

FROM gcr.io/google-appengine/python@sha256:c6480acd38ca4605e0b83f5196ab6fe8a8b59a0288a7b8216c42dbc45b5de8f6

LABEL python_version=python3.7

RUN virtualenv --no-download /env -p python3.7

ENV VIRTUAL_ENV /env

ENV PATH /env/bin:$PATH

ADD requirements.txt /app/

RUN pip install -r requirements.txt

ADD . /app/

CMD exec gunicorn -b :$PORT myteam.wsgi
Run Code Online (Sandbox Code Playgroud)

我的问题是为什么我们看不到命令​​:

python manage.py runserver

相反,我们看到: gunicorn -b :$PORT myteam.wsgi

这是否意味着gunicorn命令运行服务器?

Ern*_*toC 1

App Engine 部署通常会处理来自世界各地用户的大量流量。当您在 django 应用程序中运行时python manage.py runserver,您将在本地计算机上为该应用程序提供服务以用于开发目的。

\n

理论上,您可以在 App Engine 应用程序中使用它作为容器命令,但这不是其预期目的,并且从不推荐

\n
\n

现在\xe2\x80\x99是一个值得注意的好时机:不要\xe2\x80\x99在任何类似于生产环境的地方使用此服务器。它\xe2\x80\x99s 仅用于开发时使用...

\n
\n

App Engine 部署需要更强大的 Web 服务器软件,并且对于需要使用WSGI服务器(例如 Gunicorn)来为应用程序提供服务的 Python 应用程序。

\n

由于 Django 可以轻松地与 Gunicorn 集成,因此您所需要的只是在 App Engine 示例 Dockerfile 中看到的命令。

\n