docker运行python3.8

FROM python:3.8 AS pipenv_build

RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
    pip install pipenv

COPY ./Pipfile* /tmp/
RUN cd /tmp && \
    pipenv lock --requirements > requirements.txt

# ==========

FROM python:3.8

WORKDIR /src

COPY --from=pipenv_build /tmp/requirements.txt .
RUN pip install -r requirements.txt

ADD . .
CMD uvicorn server:app --host=0.0.0.0 --port=5000
posted @ 2020-03-01 17:01  公众号python学习开发  阅读(935)  评论(0编辑  收藏  举报