diff --git a/server/mongo/src/storage.ts b/server/mongo/src/storage.ts index c3dbefc120..5554436b05 100644 --- a/server/mongo/src/storage.ts +++ b/server/mongo/src/storage.ts @@ -749,10 +749,14 @@ abstract class MongoAdapterBase implements DbAdapter { } const doc = await coll.findOne(mongoQuery, findOptions) - if (doc != null) { - return toFindResult([doc as unknown as T]) + let total = -1 + if (options.total === true) { + total = await coll.countDocuments(mongoQuery) } - return toFindResult([]) + if (doc != null) { + return toFindResult([doc as unknown as T], total) + } + return toFindResult([], total) }, { mongoQuery } ) diff --git a/services/rekoni/Dockerfile b/services/rekoni/Dockerfile index 607c028473..bc1fe9c95c 100644 --- a/services/rekoni/Dockerfile +++ b/services/rekoni/Dockerfile @@ -1,37 +1,12 @@ -FROM node:20-alpine AS build - -WORKDIR /usr/src/app - -RUN apk upgrade --update && apk add \ - coreutils \ - libxml2-dev \ - html2text \ - autoconf \ - automake \ - build-base \ - gcc - -RUN cd ~ && \ - wget http://www.gnu.org/software/unrtf/unrtf-0.21.9.tar.gz && \ - tar xzvf unrtf-0.21.9.tar.gz && \ - cd unrtf-0.21.9/ && \ - ./bootstrap && \ - ./configure && \ - make && \ - make install - - FROM node:20-alpine AS runtime RUN apk upgrade --update && apk add \ coreutils \ antiword \ poppler-utils \ - html2text + html2text \ + unrtf ENV NODE_ENV=production -COPY --from=build /usr/local/bin/unrtf /usr/local/bin -RUN mkdir /usr/local/share/unrtf -COPY --from=build /usr/local/share/unrtf/* /usr/local/share/unrtf/ WORKDIR /usr/src/app RUN npm install --ignore-scripts=false --verbose sharp@v0.30.2 pdfjs-dist@v2.12.313 --unsafe-perm COPY bundle/bundle.js ./