Supervisord running flask app calling docker app
@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')
When I run the flask app through gunicorn and use supervisor to keep it going – the app launches – api’s work normally EXCEPT THE DOCKERIZED part.
I am guessing this has something to do with the permissions of some sort but I cant figure out what exactly I need to do to solve this.
Here is my
supervisord.conf for reference.
[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
Is there any changes I need to do to any part of this whole tool chain so that I cna get it working fine ?