Reorder dockerfile
This creates more intermediates, but moves those that are less likely to change to the top of the file. In theory this will produce faster builds on a developer's machine as they won't need to apt-get update every time.
This commit is contained in:
		
							parent
							
								
									54fceededa
								
							
						
					
					
						commit
						fbdf841f33
					
				
					 1 changed files with 12 additions and 4 deletions
				
			
		|  | @ -1,6 +1,8 @@ | |||
| FROM python:3.6 | ||||
| 
 | ||||
| COPY constraints.txt requirements.txt /reqs/ | ||||
| 
 | ||||
| RUN set -ex \ | ||||
|     && apt-get update | ||||
| 
 | ||||
| RUN set -ex \ | ||||
|     && buildDeps=' \ | ||||
|  | @ -15,12 +17,18 @@ RUN set -ex \ | |||
|         libmemcached-dev \ | ||||
|         libsasl2-dev \ | ||||
|     ' \ | ||||
|     && apt-get update \ | ||||
| 
 | ||||
|     && apt-get install -y git xmlsec1 libmysqlclient18 \ | ||||
|     && apt-get install -y $buildDeps --no-install-recommends \ | ||||
|     && rm -rf /var/lib/apt/lists/* \ | ||||
|     && rm -rf /var/lib/apt/lists/* | ||||
| 
 | ||||
| RUN set -ex \ | ||||
|     && pip install uwsgi | ||||
| 
 | ||||
| COPY constraints.txt requirements.txt /reqs/ | ||||
| 
 | ||||
| RUN set -ex \ | ||||
|     && pip install --no-cache-dir -r /reqs/requirements.txt -c /reqs/constraints.txt \ | ||||
|     && pip install uwsgi \ | ||||
|     && apt-get purge -y --auto-remove $buildDeps \ | ||||
|     && rm -rf /usr/src/python ~/.cache | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 James Polley
						James Polley