-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
51 lines (37 loc) · 1.49 KB
/
Dockerfile
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
50
51
FROM ubuntu:21.04
WORKDIR /tmp
ENV TZ=Etc/UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Instalação dos pacotes pré-requisitos do ocr-server 2
RUN apt-get -y update && \
apt-get install -y tesseract-ocr tesseract-ocr-por tesseract-ocr-eng tesseract-ocr-spa leptonica-progs \
poppler-utils pdftk unpaper ocaml ghostscript imagemagick libcamlpdf-ocaml rsyslog \
wget perl libfile-find-rule-perl libfile-touch-perl libunix-syslog-perl
RUN wget \
https://raw.githubusercontent.com/coherentgraphics/cpdf-binaries/master/Linux-Intel-64bit/cpdf \
-O /usr/local/bin/cpdf && \
chmod 755 /usr/local/bin/cpdf
RUN update-rc.d rsyslog defaults
RUN useradd -m ocr
# Cópia de arquivos do projeto OCR-SERVER
COPY usr/local/bin/ocr /usr/local/bin/ocr
COPY etc/init.d/ocr-ubuntu /etc/init.d/ocr
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /usr/local/bin/ocr && \
chmod +x /etc/init.d/ocr && \
update-rc.d ocr defaults
RUN mkdir /var/ocr-server/ && \
mkdir -p /var/ocr-server/Entrada && \
mkdir -p /var/ocr-server/Saida && \
mkdir -p /var/ocr-server/Originais_Processados && \
mkdir -p /var/ocr-server/Erro && \
chmod +x /entrypoint.sh
RUN mkdir -p /tmp/ocr_dev/ && \
mkdir -p /tmp/ocr_dev/Entrada && \
mkdir -p /tmp/ocr_dev/Saida && \
mkdir -p /tmp/ocr_dev/Originais_Processados && \
mkdir -p /tmp/ocr_dev/Erro && \
chmod -R 777 /tmp/ocr_dev
WORKDIR /
VOLUME /var/ocr-server/
CMD ["bash", "/entrypoint.sh"]