Skip to content

Commit

Permalink
Add dockerfile for issue lukas-blecher/LaTeX-OCR#392
Browse files Browse the repository at this point in the history
  • Loading branch information
takmin committed Oct 24, 2024
1 parent 0f26613 commit ffff051
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docker/Dockerfile-fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM nvcr.io/nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04

ENV PROJECT_DIR=/root/latexocr

RUN set -x \
&& apt update \
&& apt upgrade -y

RUN set -x \
&& apt update \
&& apt -y install locales \
&& locale-gen ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL=ja_JP.UTF-8
RUN localedef -f UTF-8 -i ja_JP ja_JP.utf8

RUN set -x \
&& apt -y install python3.8 python3.8-dev \
&& ln -s /usr/bin/python3.8 /usr/bin/python \
&& apt -y install wget python3-distutils \
&& wget https://bootstrap.pypa.io/get-pip.py \
&& python get-pip.py \
&& python -m pip install --upgrade pip==24.0

ENV TZ=Asia/Tokyo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN mkdir -p ${PROJECT_DIR}
COPY proc_latexocr.py ${PROJECT_DIR}
COPY read_ndlocr_xml.py ${PROJECT_DIR}

RUN set -x \
&& pip install "pix2tex[gui]"

### For LaTeX-OCR ISSUE #392 ###
COPY docker/cli.patch ${PROJECT_DIR}
RUN set -x && apt install -y patch
RUN patch -p0 < ${PROJECT_DIR}/cli.patch
RUN rm ${PROJECT_DIR}/cli.patch
###############################

WORKDIR ${PROJECT_DIR}

0 comments on commit ffff051

Please sign in to comment.