A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
don't build front end with docker
jonaswinkler1e185d15026f
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex e2918d276..f0df7e608 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -72,17 +72,18 @@ jobs:with:node-version: '15'- name: build- run: |- cd src-ui/- npm install -g @angular/cli- npm install- ng build --prod+ run: ./build-frontend.sh+ - uses: actions/upload-artifact@v2+ with:+ name: frontend-compiled+ path: src/documents/static/frontend/# build and push image to docker hub.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-*')runs-on: ubuntu-latest# needs: tests+ needs: frontendsteps:-name: Prepare@@ -99,6 +100,11 @@ jobs:-name: Checkoutuses: actions/checkout@v2+ -+ uses: actions/download-artifact@v2+ with:+ name: frontend-compiled+ path: src/documents/static/frontend/-name: Set up Docker Buildxuses: docker/setup-buildx-action@v1@@ -125,7 +131,7 @@ jobs:with:context: .file: ./Dockerfile- platforms: linux/amd64,linux/arm/v7,linux/arm64+ platforms: linux/amd64 # ,linux/arm/v7,linux/arm64push: truetags: jonaswinkler/paperless-ng:${{ steps.prepare.outputs.version }}cache-from: type=local,src=/tmp/.buildx-cachediff --git a/Dockerfile b/Dockerfileindex ee19e0cc0..4a52568ea 100644--- a/Dockerfile+++ b/Dockerfile@@ -8,27 +8,15 @@ RUN git clone https://github.com/agl/jbig2enc .RUN ./autogen.shRUN ./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-slimWORKDIR /usr/src/paperless/COPY requirements.txt ./-#Dependencies+# Binary dependenciesRUN apt-get update \&& apt-get -y --no-install-recommends install \- build-essential \curl \file \fonts-liberation \@@ -37,13 +25,6 @@ RUN apt-get update \gnupg \icc-profiles-free \imagemagick \- libatlas-base-dev \- liblept5 \- libmagic-dev \- libpoppler-cpp-dev \- libpq-dev \- libqpdf-dev \- libxml2 \libxslt1-dev \mime-support \optipng \@@ -59,8 +40,21 @@ RUN apt-get update \tzdata \unpaper \zlib1g \- && pip3 install --upgrade supervisor \- && python3 -m pip install -r requirements.txt \+ && rm -rf /var/lib/apt/lists/*++# 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 autoremove --purge \&& rm -rf /var/lib/apt/lists/* \@@ -81,7 +75,6 @@ COPY --from=jbig2enc /usr/src/jbig2enc/src/*.h /usr/local/include/# copy appCOPY src/ ./src/-COPY --from=frontend /usr/src/paperless/src-ui/dist/paperless-ui/ /usr/src/paperless/src/documents/static/frontend/# add users, setup scriptsRUN addgroup --gid 1000 paperless \diff --git a/compile-frontend.sh b/compile-frontend.shnew file mode 100755index 000000000..98b88d033--- /dev/null+++ b/compile-frontend.sh@@ -0,0 +1,7 @@+#!/bin/bash++set -e++cd src-ui+npm install+./node_modules/.bin/ng build --proddiff --git a/src-ui/angular.json b/src-ui/angular.jsonindex 414cd4f64..829a482af 100644--- a/src-ui/angular.json+++ b/src-ui/angular.json@@ -58,6 +58,7 @@"with": "src/environments/environment.prod.ts"}],+ "outputPath": "../src/documents/static/frontend/","optimization": true,"outputHashing": "none","sourceMap": false,