优化镜像分层
This commit is contained in:
10
Dockerfile
10
Dockerfile
@@ -11,12 +11,14 @@ ENV PYTHONUNBUFFERED=1 \
|
|||||||
# 设置pip镜像地址,加快安装速度
|
# 设置pip镜像地址,加快安装速度
|
||||||
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
|
PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
|
|
||||||
# 安装依赖
|
# 安装库
|
||||||
COPY sources.list /etc/apt/sources.list
|
COPY sources.list /etc/apt/sources.list
|
||||||
COPY requirements.txt /app/requirements.txt
|
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone \
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone \
|
||||||
&& apt-get update && apt-get install libgl1 \
|
&& apt-get install libgl1
|
||||||
&& pip install --no-cache-dir -r requirements.txt
|
|
||||||
|
# 安装依赖
|
||||||
|
COPY requirements.txt /app/requirements.txt
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# 将当前目录内容复制到容器的/app内
|
# 将当前目录内容复制到容器的/app内
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|||||||
Reference in New Issue
Block a user