Merge pull request #848 from MengDanzz/master
将Dockerfile COPY分成两段,缓存依赖库,重新构建不需要重新安装
This commit is contained in:
		
						commit
						2e1bb7311c
					
				
							
								
								
									
										10
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Dockerfile
									
									
									
									
									
								
							@ -10,12 +10,16 @@ RUN echo '[global]' > /etc/pip.conf && \
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
WORKDIR /gpt
 | 
					WORKDIR /gpt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 装载项目文件
 | 
					
 | 
				
			||||||
COPY . .
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 安装依赖
 | 
					# 安装依赖
 | 
				
			||||||
 | 
					COPY requirements.txt ./
 | 
				
			||||||
 | 
					COPY ./docs/gradio-3.32.2-py3-none-any.whl ./docs/gradio-3.32.2-py3-none-any.whl
 | 
				
			||||||
 | 
					RUN pip3 install -r requirements.txt
 | 
				
			||||||
 | 
					# 装载项目文件
 | 
				
			||||||
 | 
					COPY . .
 | 
				
			||||||
RUN pip3 install -r requirements.txt
 | 
					RUN pip3 install -r requirements.txt
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 可选步骤,用于预热模块
 | 
					# 可选步骤,用于预热模块
 | 
				
			||||||
RUN python3  -c 'from check_proxy import warm_up_modules; warm_up_modules()'
 | 
					RUN python3  -c 'from check_proxy import warm_up_modules; warm_up_modules()'
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user