Created
October 19, 2023 09:07
-
-
Save foxracle/610e9ac1e86ab53fe82667d64ff28d0f to your computer and use it in GitHub Desktop.
python_env_dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8.12 | |
WORKDIR /usr/src/app | |
# set noninteractive | |
ENV TZ=Asia/Shanghai \ | |
DEBIAN_FRONTEND=noninteractive | |
# set Asia/Shanghai timezone | |
RUN ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime \ | |
&& echo ${TZ} > /etc/timezone \ | |
&& dpkg-reconfigure --frontend noninteractive tzdata \ | |
&& rm -rf /var/lib/apt/lists/* | |
# update source.list | |
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list | |
# install zip | |
RUN apt-get update && apt-get install -y zip && rm -rf /var/lib/apt/lists/* | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple | |
CMD ["pytest", "-V"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment