我有一個在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與supervisord像[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