Python web服务部署

近期学习了基于python的人脸识别的web服务,特将服务部署的方式记录下。

整体部署方式:docker + supervisor + nginx + gunicorn + flask,如下图所示:
在这里插入图片描述

  1. 服务对外以docker镜像进行提供;
  2. 使用supervisor监听、启动、停止、重启进程。当一个进程被意外终止后,supervisor可以自动进行进程重启。具体安装及配置请参考https://blog.csdn.net/zou79189747/article/details/80403016
  3. 使用nginx作为http代理服务器,实现高并发和负载均衡,参考https://www.cnblogs.com/wcwnina/p/8728391.html
  4. 使用gunicorn作为wsgi http server,参考什么是wsgi如何部署gunicorn,gunicorn运行指令https://blog.csdn.net/bbwangj/article/details/82684573https://www.cnblogs.com/xiao3c/p/9684323.htmlhttps://www.cnblogs.com/xiao3c/p/9684323.html

代码的开发过程中使用了Gevent和Threading模块,按照协程方式运行。
Gevent:https://www.jianshu.com/p/861f29ac68e8
Threading:https://www.runoob.com/python/python-multithreading.html

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值