我有一个在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文件。在码头集装箱内,我正在启动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据我所知我所有的道路都应该是正确的..。我的文件在码头容器中的简化树如下
/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
发布于 2014-12-28 08:28:20
结果发现我很蠢。
[docker]部分的uwsgi.ini需要有ini = :base,而不是init = :base。基本部分没有被解析,所以wsgi模块永远不会被设置。
朋友们,总是校对你的作品。
https://stackoverflow.com/questions/27665985
复制相似问题