diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6bd7f73 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ocrd/core:edge +MAINTAINER OCR-D +ENV DEBIAN_FRONTEND noninteractive +ENV PYTHONIOENCODING utf8 +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 + +WORKDIR /build +COPY Makefile . +COPY setup.py . +COPY ocrd-tool.json . +COPY requirements.txt . +COPY ocrd_calamari ocrd_calamari + +RUN make calamari/build +RUN pip3 install . + +ENTRYPOINT ["/usr/local/bin/ocrd-calamari-recognize"] + diff --git a/Makefile b/Makefile index 2f88071..15a546c 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,39 @@ GIT_CLONE = git clone --depth 1 + +# Docker tag +DOCKER_TAG = ocrd/calamari + +# BEGIN-EVAL makefile-parser --make-help Makefile + +help: + @echo "" + @echo " Targets" + @echo "" + @echo " calamari git clone calamari" + @echo " calamari_models git clone calamari_models" + @echo " calamari/build Install calamari" + @echo " docker Build docker image" + @echo "" + @echo " Variables" + @echo "" + @echo " DOCKER_TAG Docker tag" + +# END-EVAL + +# git clone calamari calamari: $(GIT_CLONE) https://github.com/chwick/calamari +# git clone calamari_models calamari_models: $(GIT_CLONE) https://github.com/chwick/calamari_models +# Install calamari calamari/build: calamari calamari_models cd calamari &&\ pip install -r requirements.txt ;\ python setup.py install + +# Build docker image +docker: + docker build -t '$(DOCKER_TAG)' .