-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.dev
52 lines (45 loc) · 1.62 KB
/
Dockerfile.dev
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
52
FROM ruby:2.5
RUN tmpdir="$(mktemp -d)" \
&& cd "$tmpdir" \
&& curl -sSL -o "$tmpdir/leptonica.tar.gz" https://github.com/DanBloomberg/leptonica/releases/download/1.74.4/leptonica-1.74.4.tar.gz \
&& tar xf leptonica.tar.gz \
&& cd leptonica-1.74.4 \
&& ./configure \
&& make -j8 \
&& make install \
&& cd / \
&& rm -rf "$tmpdir"
RUN tmpdir="$(mktemp -d)" \
&& cd "$tmpdir" \
&& git clone https://github.com/tesseract-ocr/tesseract.git \
&& cd tesseract \
&& git checkout 3.05 \
&& ./autogen.sh \
&& ./configure \
&& make -j8 \
&& make install \
&& curl -sSL -o /usr/local/share/tessdata/osd.traineddata https://github.com/tesseract-ocr/tessdata/raw/3.04.00/osd.traineddata \
&& curl -sSL -o /usr/local/share/tessdata/deu.traineddata https://github.com/tesseract-ocr/tessdata/raw/3.04.00/deu.traineddata \
&& curl -sSL -o /usr/local/share/tessdata/eng.traineddata https://github.com/tesseract-ocr/tessdata/raw/3.04.00/eng.traineddata \
&& cd / \
&& rm -rf "$tmpdir"
ENV TESSDATA_PREFIX=/usr/local/share
RUN apt-get update && \
apt-get -y install locales sane-utils ghostscript && \
groupadd --gid 1000 app && \
adduser --disabled-login --uid 1000 --gid 1000 --gecos '' app && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
echo test >> /etc/sane.d/dll.conf
COPY Gemfile* /usr/src/app/
RUN echo '2.5.0' > /usr/src/app/.ruby-version && \
cd /usr/src/app && \
bundle install -j 8 && \
chown -R app:app /usr/local/bundle
USER app
WORKDIR /usr/src/app
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8