From 40f5c4b700ab741149f93fa0e2f845b946094e2e Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Mon, 19 Feb 2018 13:26:55 +0100 Subject: [PATCH] Add pip, coverage and reorder Dockerfile --- Dockerfile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 42099fb3..9ce6794b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,25 @@ +# USAGE +# 1. Build new Docker container: +# > docker build -t ocropy -f Dockerfile . +# 2. Run this Docker container: +# > docker run -it --rm -v ${PWD}:/ocropy ocropy bash +# 3. Run tests: +# ># ./run-test + FROM ubuntu:16.04 -MAINTAINER Konstantin Baierer +MAINTAINER Philipp Zumstein ENV DEBIAN_FRONTEND noninteractive ENV PYTHONIOENCODING utf8 WORKDIR /ocropy +COPY PACKAGES . RUN apt-get update && \ apt-get -y install --no-install-recommends git ca-certificates wget unzip && \ + apt-get install -y python-pip $(cat PACKAGES) && \ git clone --depth 1 'https://github.com/kba/ocr-models-client' /ocr-models-client && \ - /ocr-models-client/ocr-models download -d models 'ocropy/en-default' 'ocropy/fraktur' -COPY PACKAGES . -RUN apt-get install -y $(cat PACKAGES) -COPY . . -RUN python setup.py install && \ + /ocr-models-client/ocr-models download -d models 'ocropy/en-default' 'ocropy/fraktur' && \ + pip install --upgrade pip coverage && \ apt-get -y remove --purge --auto-remove git wget unzip && \ apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* +COPY . . +RUN python setup.py install