【发布时间】:2015-02-24 06:55:31
【问题描述】:
我有一个在 Docker 容器中运行的 uwsgi 服务,我想用它来为 django 应用程序提供服务。当我在本地运行 uwsgi 服务时,一切正常,但是从 docker 容器中我收到消息 *** no app loaded. going in full dynamic mode *** 和 --- no python application found, check your startup logs for errors --- 并且 django 应用程序显示内部服务器错误。这是我的 uwsgi.ini 文件。在 docker 容器中,我使用 supervisord 启动 uwsgi,例如 [program:uwsgi]
command = /usr/local/bin/uwsgi --ini /home/docker/code/uwsgi.ini:docker
[uwsgi]
# this config will be loaded if nothing specific is specified
# load base config from below
ini = :base
[dev]
ini = :base
# socket (uwsgi) is not the same as http, nor http-socket
socket = :8001
[local]
ini = :base
http = :8000
# set the virtual env to use
home=/Users/Robbie/.virtualenvs/my_virtualenv
[docker]
init = :base
logto = /var/logs/uwsgi.log
http = :80
master = true
processes = 6
[base]
# chdir to the folder of this config file, plus app/website
chdir = %ddjango_project_root_dir/
module=project_app.wsgi:application
# Set settings module.
env = DJANGO_SETTINGS_MODULE=project_app.settings
chmod-socket=664
据我所知,我的所有路径都应该是正确的......我在 docker 容器中的文件的简化树就像
/home/docker/code
|
|____ uwsgi.ini
|____ supervisor.conf
|
└── django_project_root_dir
│
└── project_app
├── __init__.py
├── settings.py
└── wsgi.py
编辑
当我运行 docker exec DOCKER_ID uwsgi --ini /home/docker/code/uwsgi.ini:local 时,我得到了响应 docker-exec: failed to exec: exec: "pyuwsgi": executable file not found in $PATH
【问题讨论】:
标签: python django docker uwsgi