mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	removed ENV WORKDIR layers, reorg the commands in groups with comments
and black lines when possible. Removed redundant mkdir command
This commit is contained in:
		
							
								
								
									
										20
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,25 +1,26 @@ | |||||||
| FROM alpine:3.7 | FROM alpine:3.7 | ||||||
| WORKDIR /usr/src/paperless |  | ||||||
| COPY requirements.txt /usr/src/paperless/ |  | ||||||
| # Copy application | # Copy application | ||||||
|  | COPY requirements.txt /usr/src/paperless/ | ||||||
| COPY src/ /usr/src/paperless/src/ | COPY src/ /usr/src/paperless/src/ | ||||||
| COPY data/ /usr/src/paperless/data/ | COPY data/ /usr/src/paperless/data/ | ||||||
| COPY media/ /usr/src/paperless/media/ | COPY media/ /usr/src/paperless/media/ | ||||||
| # Set export directory |  | ||||||
| ENV PAPERLESS_EXPORT_DIR /export |  | ||||||
| # Set consumption directory |  | ||||||
| ENV PAPERLESS_CONSUMPTION_DIR /consume |  | ||||||
| COPY scripts/docker-entrypoint.sh /sbin/docker-entrypoint.sh | COPY scripts/docker-entrypoint.sh /sbin/docker-entrypoint.sh | ||||||
|  |  | ||||||
|  | # Set export and consumption directories | ||||||
|  | ENV PAPERLESS_EXPORT_DIR=/export \ | ||||||
|  |     PAPERLESS_CONSUMPTION_DIR=/consume | ||||||
|  |  | ||||||
| # Install dependencies | # Install dependencies | ||||||
| RUN apk --no-cache --update add \ | RUN apk --no-cache --update add \ | ||||||
|         python3 gnupg libmagic bash \ |         python3 gnupg libmagic bash \ | ||||||
|         sudo tesseract-ocr imagemagick ghostscript unpaper && \ |         sudo tesseract-ocr imagemagick ghostscript unpaper && \ | ||||||
|     apk --no-cache add --virtual .build-dependencies \ |     apk --no-cache add --virtual .build-dependencies \ | ||||||
|         python3-dev gcc musl-dev zlib-dev jpeg-dev && \ |         python3-dev gcc musl-dev zlib-dev jpeg-dev && \ | ||||||
| ## Install python dependencies | # Install python dependencies | ||||||
|     python3 -m ensurepip && \ |     python3 -m ensurepip && \ | ||||||
|     rm -r /usr/lib/python*/ensurepip && \ |     rm -r /usr/lib/python*/ensurepip && \ | ||||||
|     mkdir -p /usr/src/paperless && \ |     cd /usr/src/paperless && \ | ||||||
|     pip3 install --no-cache-dir -r requirements.txt && \ |     pip3 install --no-cache-dir -r requirements.txt && \ | ||||||
| # Remove build dependencies | # Remove build dependencies | ||||||
|     apk del .build-dependencies && \ |     apk del .build-dependencies && \ | ||||||
| @@ -34,8 +35,9 @@ RUN apk --no-cache --update add \ | |||||||
|     mkdir -p $PAPERLESS_EXPORT_DIR && \ |     mkdir -p $PAPERLESS_EXPORT_DIR && \ | ||||||
| # Setup entrypoint | # Setup entrypoint | ||||||
|     chmod 755 /sbin/docker-entrypoint.sh |     chmod 755 /sbin/docker-entrypoint.sh | ||||||
|  |  | ||||||
| WORKDIR /usr/src/paperless/src | WORKDIR /usr/src/paperless/src | ||||||
| # Mount volumes | # Mount volumes and set Entrypoint | ||||||
| VOLUME ["/usr/src/paperless/data", "/usr/src/paperless/media", "/consume", "/export"] | VOLUME ["/usr/src/paperless/data", "/usr/src/paperless/media", "/consume", "/export"] | ||||||
| ENTRYPOINT ["/sbin/docker-entrypoint.sh"] | ENTRYPOINT ["/sbin/docker-entrypoint.sh"] | ||||||
| CMD ["--help"] | CMD ["--help"] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Guy Addadi
					Guy Addadi