基于docker 安装gevent
FROM python:3.7.4-alpine #FROM scratch LABEL maintainer="i.1214" WORKDIR ./ COPY ./ ./ # important, 这里是需要安装alpine缺少的依赖包 RUN apk update && \ apk add --no-cache ca-certificates && \ apk add --no-cache --virtual .build-deps gcc musl-dev # gevent 在这个 requirements.txt 中, gevent==1.4.0 RUN pip install --no-cache-dir -r requirements.txt # 安装完成后清理缓存 RUN apk del .build-deps gcc musl-dev && \ rm -rf /var/cache/apk/* EXPOSE 5000 ENTRYPOINT ["gunicorn", "--config", "./configs/gunicorn.py", "app:app"]