From 2f57b1a0afb6faabc308130e47f66a465a02eb5b Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Wed, 11 Sep 2019 13:20:07 +0200
Subject: [PATCH] Use fix version numbers.
---
Dockerfile | 71 ++++++++++++++++++++++++++++++++---------------------
wrapper/nlp | 2 +-
2 files changed, 44 insertions(+), 29 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 165212e..5a42b83 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,40 +1,55 @@
FROM debian:9-slim
+
LABEL maintainer="inf_sfb1288@lists.uni-bielefeld.de"
-ENV DEBIAN_FRONTEND=noninteractive
-ENV LANG=C.UTF-8
-RUN apt-get update && \
- apt-get install -y --no-install-recommends \
- build-essential \
- ca-certificates \
- python2.7 \
- python3.5 \
- python3-dev \
- python3-pip \
- python3-setuptools \
- wget
+# Install prerequisites
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends \
+ python2.7 \
+ python3.5 \
+ python3-pip \
+ && rm -rf /var/lib/apt/lists/* \
+ && pip3 install \
+ setuptools \
+ wheel
-# Install pyFlow
-ENV PYFLOW_VERSION 1.1.20
-RUN wget -nv https://github.com/Illumina/pyflow/releases/download/v"$PYFLOW_VERSION"/pyflow-"$PYFLOW_VERSION".tar.gz && \
- tar -xzf pyflow-"$PYFLOW_VERSION".tar.gz && \
- cd pyflow-"$PYFLOW_VERSION" && \
- python2.7 setup.py build install && \
- cd .. && \
- rm -r pyflow-"$PYFLOW_VERSION" pyflow-"$PYFLOW_VERSION".tar.gz
-# Install spaCy
-RUN pip3 install wheel && pip3 install -U spacy && \
- python3.5 -m spacy download de && \
- python3.5 -m spacy download en && \
- python3.5 -m spacy download es && \
- python3.5 -m spacy download fr && \
- python3.5 -m spacy download it && \
- python3.5 -m spacy download pt
+# pyFlow
+ENV PYFLOW_VERSION=1.1.20
+ADD "https://github.com/Illumina/pyflow/releases/download/v${PYFLOW_VERSION}/pyflow-${PYFLOW_VERSION}.tar.gz" .
+RUN tar -xzf "pyflow-${PYFLOW_VERSION}.tar.gz" \
+ && cd "pyflow-${PYFLOW_VERSION}" \
+ && python2.7 setup.py build install \
+ && cd .. \
+ && rm -rf \
+ "pyflow-${PYFLOW_VERSION}" \
+ "pyflow-${PYFLOW_VERSION}.tar.gz"
+
+# spaCy
+ENV SPACY_MODELS_DE=de_core_news_sm \
+ SPACY_MODELS_EL=el_core_news_sm \
+ SPACY_MODELS_EN=en_core_web_sm \
+ SPACY_MODELS_ES=es_core_news_sm \
+ SPACY_MODELS_FR=fr_core_news_sm \
+ SPACY_MODELS_IT=it_core_news_sm \
+ SPACY_MODELS_NL=nl_core_news_sm \
+ SPACY_MODELS_PT=pt_core_news_sm \
+ SPACY_VERSION=2.1.0
+RUN pip3 install \
+ "spacy==${SPACY_VERSION}" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_DE}-${SPACY_VERSION}/${SPACY_MODELS_DE}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_EL}-${SPACY_VERSION}/${SPACY_MODELS_EL}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_EN}-${SPACY_VERSION}/${SPACY_MODELS_EN}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_ES}-${SPACY_VERSION}/${SPACY_MODELS_ES}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_FR}-${SPACY_VERSION}/${SPACY_MODELS_FR}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_IT}-${SPACY_VERSION}/${SPACY_MODELS_IT}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_NL}-${SPACY_VERSION}/${SPACY_MODELS_NL}-${SPACY_VERSION}.tar.gz" \
+ "https://github.com/explosion/spacy-models/releases/download/${SPACY_MODELS_PT}-${SPACY_VERSION}/${SPACY_MODELS_PT}-${SPACY_VERSION}.tar.gz"
COPY nlp /usr/local/bin
COPY spacy_nlp /usr/local/bin
ENTRYPOINT ["nlp"]
+CMD ["--help"]
diff --git a/wrapper/nlp b/wrapper/nlp
index b9dfca9..330bc32 100755
--- a/wrapper/nlp
+++ b/wrapper/nlp
@@ -5,7 +5,7 @@ import argparse
import os
import subprocess
-container_image = 'gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/nlp:latest'
+container_image = 'gitlab.ub.uni-bielefeld.de:4567/sfb1288inf/nlp:2.1.0'
container_input_dir = '/input'
container_output_dir = '/output'
uid = str(os.getuid())