Supervisord运行瓶应用程序调用docker应用程序

我有一个应用程序,使用subprocess进程调用我的dockerized应用程序。

 @app.route('/detect', methods=['POST']) def detect_file(): file = request.files['wireframe'] if file and allowed_file(file.filename): filename = str(uuid.uuid4()) + getFileExtension(file.filename) file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename)) p = subprocess.Popen(["docker","run","-v","/home/ganaraj/contours/upload:/detect","-w", "/detect","-it","--rm","opecv3", "./prediction", filename ], stdout=subprocess.PIPE) output, err = p.communicate() return jsonify(result=output.rstrip()) return jsonify(error='Mismatch file type') 

当我运行它自己的python app.py烧瓶应用程序,它工作得很好。 我从dockerized应用程序得到一个结果。 当我运行使用gunicorn gunicorn wsgi.py的烧瓶应用程序,它也能正常工作。

当我通过gunicorn运行烧瓶应用程序,并使用主pipe保持发展 – 应用程序启动 – API的工作通常除了DOCKERIZED部分。 我猜这与某种types的权限有关,但我无法弄清楚我需要做什么来解决这个问题。

这里是我的supervisord.conf供参考。

 [program:cvupload] command = /root/anaconda/envs/cvuload/bin/gunicorn -b 0.0.0.0:9000 --debug --log-level debug wsgi:app directory = /home/ganaraj/contours user=root 

是否有任何改变,我需要做的整个工具链的任何部分,以便我能得到它工作正常?