Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Revert "Add minimum column width as an option to reading order (#2)" This reverts commit 95efdd2. PR #43 should be merged before having considered this change stable. * docker improvements
- Loading branch information
slallemand
authored and
Aarohi Johal
committed
Sep 27, 2019
1 parent
e50c0b8
commit 482dbdc
Showing
11 changed files
with
227 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM debian:10 as builder | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y git build-essential | ||
|
||
RUN git clone https://github.com/AXATechLab/pdf2json /src/pdf2json && \ | ||
cd /src/pdf2json && \ | ||
./configure --prefix=/opt/pdf2json && \ | ||
make -j && \ | ||
make install && \ | ||
cd /src && \ | ||
rm -rf pdf2json | ||
|
||
|
||
FROM debian:10 as engine | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y imagemagick mupdf mupdf-tools qpdf pandoc tesseract-ocr-all nodejs npm python-pdfminer python-pip python3-pip python-tk python3-pdfminer python3-opencv && \ | ||
pip install ghostscript camelot-py && \ | ||
pip3 install ghostscript camelot-py | ||
|
||
WORKDIR /opt/app-root/src | ||
RUN chown 1001:0 /opt/app-root/src | ||
|
||
COPY --from=builder /opt/pdf2json /opt/pdf2json | ||
COPY --chown=1001:0 . /opt/app-root/src | ||
|
||
|
||
ENV PATH $PATH:/opt/app-root/src/node_modules/.bin:/opt/pdf2json/bin | ||
ENV HOME /opt/app-root/src | ||
|
||
USER 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM registry.access.redhat.com/ubi8/nodejs-10 as build | ||
|
||
# Disable RHSM | ||
USER root | ||
RUN sed -i -e 's/^\(enabled\).*/\1=0/g' /etc/yum/pluginconf.d/subscription-manager.conf | ||
USER 1001 | ||
|
||
ARG NODE_ENV=development | ||
ARG DEV_MODE=true | ||
|
||
ARG VUE_APP_API=${VUE_APP_API} | ||
|
||
#COPY --chown=1001:root demo/vue-viewer /opt/app-root/src | ||
#COPY --chown=1001:root docker/parsr-ui docker/parsr-ui | ||
|
||
COPY --chown=1001:root . /opt/app-root/src | ||
|
||
RUN docker/parsr-ui/build.sh | ||
|
||
|
||
FROM nginx:stable | ||
|
||
COPY --from=build /opt/app-root/src/demo/vue-viewer/dist /usr/share/nginx/html | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY docker/parsr-ui/nginx.conf /etc/nginx/conf.d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd demo/vue-viewer | ||
|
||
echo "Installing modules" | ||
npm install | ||
|
||
echo | ||
|
||
echo "Building UI" | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
server { | ||
|
||
listen 80; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html ; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
|
||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,8 @@ | ||
FROM centos:7 AS builder | ||
USER root | ||
FROM axarev/parsr-base | ||
|
||
RUN yum -y update && \ | ||
yum-config-manager --enable epel && \ | ||
yum -y groupinstall 'Development Tools' && \ | ||
yum -y install git zlib-devel libjpeg-turbo-devel libtiff-devel libpng-devel && \ | ||
mkdir /src && \ | ||
cd /src | ||
ENV NODE_ENV development | ||
|
||
RUN git clone https://github.com/AXATechLab/pdf2json && \ | ||
cd pdf2json && \ | ||
./configure --prefix=/opt/app-root && \ | ||
make -j && \ | ||
make install && \ | ||
cd /src && \ | ||
rm -rf pdf2json | ||
EXPOSE 3001 | ||
|
||
RUN curl -o mupdf.tar.gz https://www.mupdf.com/downloads/archive/mupdf-1.14.0-source.tar.gz && \ | ||
tar xvfz mupdf.tar.gz && \ | ||
cd mupdf-1.14.0-source/ && \ | ||
make prefix=/opt/app-root HAVE_GLUT=no -j install && \ | ||
cd /src && \ | ||
rm -rf mupdf-1.14.0-source | ||
|
||
|
||
RUN curl -sL https://github.com/qpdf/qpdf/releases/download/release-qpdf-8.3.0/qpdf-8.3.0.tar.gz | tar xfz - && \ | ||
cd qpdf-8.3.0 && \ | ||
./configure --prefix=/opt/app-root && \ | ||
make -j && \ | ||
make install && \ | ||
cd /src && \ | ||
rm -rf qpdf-8.3.0 | ||
|
||
RUN curl -sL https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-linux.tar.gz | tar xvfz - --strip-components 1 -C /opt/app-root | ||
|
||
RUN mkdir -p /opt/app-root/share/tessdata/ && \ | ||
git clone https://github.com/tesseract-ocr/tessdata_fast.git && \ | ||
cd tessdata_fast && \ | ||
cp *.traineddata /opt/app-root/share/tessdata/ && \ | ||
cd /src && \ | ||
rm -rf tessdata_fast | ||
|
||
USER 1001 | ||
|
||
|
||
FROM centos/nodejs-8-centos7 as engine | ||
USER root | ||
|
||
RUN yum -y update && \ | ||
yum -y install zlib libjpeg-turbo libtiff libpng ImageMagick | ||
|
||
RUN yum-config-manager --add-repo https://download.opensuse.org/repositories/home:/Alexander_Pozdnyakov/CentOS_7/ && \ | ||
rpm --import https://build.opensuse.org/projects/home:Alexander_Pozdnyakov/public_key && \ | ||
yum -y update && \ | ||
yum -y install tesseract tesseract-langpack-* | ||
|
||
COPY --from=builder /opt/app-root/bin /opt/app-root/bin | ||
COPY --from=builder /opt/app-root/etc /opt/app-root/etc | ||
COPY --from=builder /opt/app-root/include /opt/app-root/include | ||
COPY --from=builder /opt/app-root/lib /opt/app-root/lib | ||
COPY --from=builder /opt/app-root/share /opt/app-root/share | ||
|
||
ENV PATH=$PATH:/opt/app-root/bin | ||
ARG DEV_MODE=true | ||
|
||
# Copying in override assemble/run scripts | ||
COPY .s2i/bin /tmp/scripts | ||
COPY --chown=1001:root . /tmp/src | ||
|
||
USER 1001 | ||
|
||
RUN /tmp/scripts/assemble && \ | ||
mkdir -p /opt/app-root/src/demo/web-viewer/pipeline/output && \ | ||
chmod -R g+w /opt/app-root/src/demo/web-viewer && \ | ||
rm -rf /tmp/src | ||
CMD /tmp/scripts/run | ||
RUN docker/parsr/build.sh | ||
CMD docker/parsr/run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
export PATH=$PATH:$PWD/node_modules/.bin | ||
|
||
echo "Installing packages : npm install" | ||
npm install | ||
|
||
echo | ||
|
||
echo "Building typescript : npm run build:ts" | ||
npm run build:ts | ||
|
||
echo | ||
|
||
echo "Installing packages for api/server : npm install --prefix api/server" | ||
npm install --prefix api/server | ||
|
||
echo | ||
|
||
echo "Building parsr API" | ||
npm run --prefix api/server build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
|
||
echo "Starting par.sr API : node api/server/dist/index.js" | ||
#exec node api/server/dist/index.js | ||
cd api/server | ||
exec node dist/index.js |
Oops, something went wrong.