-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.opt
50 lines (43 loc) · 1.46 KB
/
Dockerfile.opt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM ubuntu:20.04
LABEL maintainer="[email protected]"
LABEL version="3.2.1"
WORKDIR /opt
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_VER=12.18.0
ENV NODE_VARIANT=node-v${NODE_VER}-linux-x64
ENV NODE_ENV=dockered
RUN useradd -u 1000 -U -m lucinda && \
apt-get update && \
apt-get install -y git \
build-essential autoconf automake libtool \
ghostscript icc-profiles-free \
liblept5 libleptonica-dev \
libxml2 libxml2-dev \
pngquant \
python3-cffi python3-distutils \
python3-pkg-resources python3-reportlab \
qpdf \
img2pdf \
tesseract-ocr tesseract-ocr-deu tesseract-ocr-fra tesseract-ocr-ita \
zlib1g-dev wget && \
rm -rf /var/lib/apt/lists/* && \
git clone https://github.com/agl/jbig2enc && \
cd jbig2enc && \
./autogen.sh && ./configure && make && make install && cd .. && \
wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && \
python3 -m pip install --user ocrmypdf && \
wget https://nodejs.org/dist/v${NODE_VER}/${NODE_VARIANT}.tar.xz && \
tar -xf ${NODE_VARIANT}.tar.xz && \
ln -s /opt/${NODE_VARIANT}/bin/node /usr/bin/node && \
ln -s /opt/${NODE_VARIANT}/bin/npm /usr/bin/npm && \
ln -s /root/.local/bin/ocrmypdf /usr/bin/ocrmypdf && \
apt-get remove -y wget git autoconf automake build-essential && \
apt-get autoremove -y && \
rm -rf jbig2enc && apt-get -y clean
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 9997
CMD ["node","src/index.js"]