首页 > 文章列表 > python Gunicorn是什么

python Gunicorn是什么

Python Gunicorn
237 2022-08-07

1、说明

gunicorn是运行在Unix下面的PythonWSGIHTTPserver,使用pre-forkworker模型(注意,Arbiter是gunicorn的master,所以称gunicorn为pre-forkworker)。

可以使用各种选项来配置gunicorn。将-reload传输到gunicorn命令中,或者将reload写到配置文件中,这样gunicorn就能在有文件改变的时候自动重启python服务。

2、实例

FROM python:3.6
 
# 创建 app 目录
WORKDIR /app
 
# 安装 app 依赖
COPY gunicorn_app/requirements.txt ./
 
RUN pip install -r requirements.txt
 
# 打包 app 源码
COPY gunicorn_app /app
 
EXPOSE 8080

本文教程操作环境:windows7系统、Python 3.9.1,DELL G3电脑。