@@ -9,6 +9,7 @@ RUN apk --no-cache add fontforge wget && \
99 wget https://cdn.jsdelivr.net/gh/notofonts/notofonts.github.io/fonts/NotoSansSymbols2/hinted/ttf/NotoSansSymbols2-Regular.ttf && \
1010 wget https://github.com/Maxattax97/gnu-freefont/raw/master/ttf/FreeSans.ttf && \
1111 wget https://github.com/impallari/DancingScript/raw/master/OFL.txt && \
12+ wget -O /model.onnx "https://github.com/docusealco/fields-detection/releases/download/1.0.0/model_704_int8.onnx" && \
1213 wget -O pdfium-linux.tgz "https://github.com/docusealco/pdfium-binaries/releases/latest/download/pdfium-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tgz" && \
1314 mkdir -p /pdfium-linux && \
1415 tar -xzf pdfium-linux.tgz -C /pdfium-linux
@@ -50,7 +51,7 @@ ENV OPENSSL_CONF=/app/openssl_legacy.cnf
5051
5152WORKDIR /app
5253
53- RUN echo '@edge https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/ apk/repositories && apk add --no-cache sqlite-dev libpq-dev mariadb-dev vips-dev@edge yaml-dev redis libheif@edge vips-heif@edge gcompat ttf-freefont && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf
54+ RUN apk add --no-cache sqlite-dev libpq-dev mariadb-dev vips-dev yaml-dev redis libheif vips-heif gcompat ttf-freefont && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf
5455
5556RUN echo $'.include = /etc/ssl/openssl.cnf\n \
5657\n \
@@ -66,7 +67,9 @@ activate = 1' >> /app/openssl_legacy.cnf
6667
6768COPY ./Gemfile ./Gemfile.lock ./
6869
69- RUN apk add --no-cache build-base && bundle install && apk del --no-cache build-base && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf
70+ RUN apk add --no-cache build-base && bundle install && apk del --no-cache build-base && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf && ln -sf /usr/lib/libonnxruntime.so.1 $(ruby -e "print Dir[Gem::Specification.find_by_name('onnxruntime').gem_dir + '/vendor/*.so'].first" )
71+
72+ RUN echo 'https://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories && echo 'https://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories && apk add --no-cache onnxruntime
7073
7174COPY ./bin ./bin
7275COPY ./app ./app
@@ -83,6 +86,7 @@ COPY --from=download /fonts/GoNotoKurrent-Regular.ttf /fonts/GoNotoKurrent-Bold.
8386COPY --from=download /fonts/FreeSans.ttf /usr/share/fonts/freefont
8487COPY --from=download /pdfium-linux/lib/libpdfium.so /usr/lib/libpdfium.so
8588COPY --from=download /pdfium-linux/licenses/pdfium.txt /usr/lib/libpdfium-LICENSE.txt
89+ COPY --from=download /model.onnx /app/tmp/model.onnx
8690COPY --from=webpack /app/public/packs ./public/packs
8791
8892RUN ln -s /fonts /app/public/fonts
0 commit comments