gpt4 book ai didi

python - uWSGI + Docker : pyuwsgi: executable file not found in $PATH

转载 作者:行者123 更新时间:2023-11-30 23:16:36 25 4
gpt4 key购买 nike

我有一个在 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

最佳答案

原来我是个傻子。

[docker] uwsgi.ini的部分需要有ini = :base ,不是init = :base 。基本部分没有被解析,因此 wsgi 模块永远不会被设置。

friend 们,请务必校对你的作品。

关于python - uWSGI + Docker : pyuwsgi: executable file not found in $PATH,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27665985/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com