mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	don't build front end with docker
This commit is contained in:
		
							
								
								
									
										18
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -72,17 +72,18 @@ jobs: | |||||||
|       with: |       with: | ||||||
|         node-version: '15' |         node-version: '15' | ||||||
|     - name: build |     - name: build | ||||||
|       run: | |       run: ./build-frontend.sh | ||||||
|         cd src-ui/ |     - uses: actions/upload-artifact@v2 | ||||||
|         npm install -g @angular/cli |       with: | ||||||
|         npm install |         name: frontend-compiled | ||||||
|         ng build --prod |         path: src/documents/static/frontend/ | ||||||
|  |  | ||||||
|   # build and push image to docker hub. |   # build and push image to docker hub. | ||||||
|   build-docker-image: |   build-docker-image: | ||||||
|     if: github.event_name == 'push' && (github.ref == 'refs/heads/travis-multiarch-builds' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.ref == 'refs/tags/ng-*') |     if: github.event_name == 'push' && (github.ref == 'refs/heads/travis-multiarch-builds' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.ref == 'refs/tags/ng-*') | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     # needs: tests |     # needs: tests | ||||||
|  |     needs: frontend | ||||||
|     steps: |     steps: | ||||||
|       - |       - | ||||||
|         name: Prepare |         name: Prepare | ||||||
| @@ -99,6 +100,11 @@ jobs: | |||||||
|       - |       - | ||||||
|         name: Checkout |         name: Checkout | ||||||
|         uses: actions/checkout@v2 |         uses: actions/checkout@v2 | ||||||
|  |       - | ||||||
|  |         uses: actions/download-artifact@v2 | ||||||
|  |         with: | ||||||
|  |           name: frontend-compiled | ||||||
|  |           path: src/documents/static/frontend/ | ||||||
|       - |       - | ||||||
|         name: Set up Docker Buildx |         name: Set up Docker Buildx | ||||||
|         uses: docker/setup-buildx-action@v1 |         uses: docker/setup-buildx-action@v1 | ||||||
| @@ -125,7 +131,7 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           context: . |           context: . | ||||||
|           file: ./Dockerfile |           file: ./Dockerfile | ||||||
|           platforms: linux/amd64,linux/arm/v7,linux/arm64 |           platforms: linux/amd64 # ,linux/arm/v7,linux/arm64 | ||||||
|           push: true |           push: true | ||||||
|           tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} |           tags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }} | ||||||
|           cache-from: type=local,src=/tmp/.buildx-cache |           cache-from: type=local,src=/tmp/.buildx-cache | ||||||
|   | |||||||
							
								
								
									
										39
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										39
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -8,27 +8,15 @@ RUN git clone https://github.com/agl/jbig2enc . | |||||||
| RUN ./autogen.sh | RUN ./autogen.sh | ||||||
| RUN ./configure && make | RUN ./configure && make | ||||||
|  |  | ||||||
|  |  | ||||||
| FROM node:15 AS frontend |  | ||||||
|  |  | ||||||
| WORKDIR /usr/src/paperless/src-ui/ |  | ||||||
|  |  | ||||||
| COPY src-ui/package* ./ |  | ||||||
| RUN npm install |  | ||||||
|  |  | ||||||
| COPY src-ui . |  | ||||||
| RUN node_modules/.bin/ng build --prod --output-hashing none --sourceMap=false |  | ||||||
|  |  | ||||||
| FROM python:3.7-slim | FROM python:3.7-slim | ||||||
|  |  | ||||||
| WORKDIR /usr/src/paperless/ | WORKDIR /usr/src/paperless/ | ||||||
|  |  | ||||||
| COPY requirements.txt ./ | COPY requirements.txt ./ | ||||||
|  |  | ||||||
| #Dependencies | # Binary dependencies | ||||||
| RUN apt-get update \ | RUN apt-get update \ | ||||||
|   && apt-get -y --no-install-recommends install \ |   && apt-get -y --no-install-recommends install \ | ||||||
| 		build-essential \ |  | ||||||
| 		curl \ | 		curl \ | ||||||
| 		file \ | 		file \ | ||||||
| 		fonts-liberation \ | 		fonts-liberation \ | ||||||
| @@ -37,13 +25,6 @@ RUN apt-get update \ | |||||||
| 		gnupg \ | 		gnupg \ | ||||||
| 		icc-profiles-free \ | 		icc-profiles-free \ | ||||||
| 		imagemagick \ | 		imagemagick \ | ||||||
| 		libatlas-base-dev \ |  | ||||||
| 		liblept5 \ |  | ||||||
| 		libmagic-dev \ |  | ||||||
| 		libpoppler-cpp-dev \ |  | ||||||
| 		libpq-dev \ |  | ||||||
| 		libqpdf-dev \ |  | ||||||
| 		libxml2 \ |  | ||||||
| 		libxslt1-dev \ | 		libxslt1-dev \ | ||||||
| 		mime-support \ | 		mime-support \ | ||||||
| 		optipng \ | 		optipng \ | ||||||
| @@ -59,8 +40,21 @@ RUN apt-get update \ | |||||||
| 		tzdata \ | 		tzdata \ | ||||||
| 		unpaper \ | 		unpaper \ | ||||||
| 		zlib1g \ | 		zlib1g \ | ||||||
| 	&& pip3 install --upgrade supervisor \ | 		&& rm -rf /var/lib/apt/lists/* | ||||||
|   && python3 -m pip install -r requirements.txt \ |  | ||||||
|  | # Python dependencies | ||||||
|  | RUN apt-get update \ | ||||||
|  |   && apt-get -y --no-install-recommends install \ | ||||||
|  | 		build-essential \ | ||||||
|  | 		libatlas-base-dev \ | ||||||
|  | 		liblept5 \ | ||||||
|  | 		libmagic-dev \ | ||||||
|  | 		libpoppler-cpp-dev \ | ||||||
|  | 		libpq-dev \ | ||||||
|  | 		libqpdf-dev \ | ||||||
|  | 		libxml2 \ | ||||||
|  | 	&& python3 -m pip install --upgrade --no-cache-dir supervisor \ | ||||||
|  |   && python3 -m pip install --no-cache-dir -r requirements.txt \ | ||||||
| 	&& apt-get -y purge build-essential libqpdf-dev \ | 	&& apt-get -y purge build-essential libqpdf-dev \ | ||||||
| 	&& apt-get -y autoremove --purge \ | 	&& apt-get -y autoremove --purge \ | ||||||
| 	&& rm -rf /var/lib/apt/lists/* \ | 	&& rm -rf /var/lib/apt/lists/* \ | ||||||
| @@ -81,7 +75,6 @@ COPY --from=jbig2enc /usr/src/jbig2enc/src/*.h /usr/local/include/ | |||||||
|  |  | ||||||
| # copy app | # copy app | ||||||
| COPY src/ ./src/ | COPY src/ ./src/ | ||||||
| COPY --from=frontend /usr/src/paperless/src-ui/dist/paperless-ui/ /usr/src/paperless/src/documents/static/frontend/ |  | ||||||
|  |  | ||||||
| # add users, setup scripts | # add users, setup scripts | ||||||
| RUN addgroup --gid 1000 paperless \ | RUN addgroup --gid 1000 paperless \ | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								compile-frontend.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								compile-frontend.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | #!/bin/bash | ||||||
|  |  | ||||||
|  | set -e | ||||||
|  |  | ||||||
|  | cd src-ui | ||||||
|  | npm install | ||||||
|  | ./node_modules/.bin/ng build --prod | ||||||
| @@ -58,6 +58,7 @@ | |||||||
| 									"with": "src/environments/environment.prod.ts" | 									"with": "src/environments/environment.prod.ts" | ||||||
| 								} | 								} | ||||||
| 							], | 							], | ||||||
|  | 							"outputPath": "../src/documents/static/frontend/", | ||||||
| 							"optimization": true, | 							"optimization": true, | ||||||
| 							"outputHashing": "none", | 							"outputHashing": "none", | ||||||
| 							"sourceMap": false, | 							"sourceMap": false, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler