forked from scastlara/ppaxe
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
87 lines (75 loc) · 2.84 KB
/
Dockerfile
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# PPaxe standalone docker requires
# + debian:jessie or ubuntu:16.04
# + python 2.7
#
# Build this docker with:
# docker build -t ppaxe.docker -f=./Dockerfile .
#
# Run this docker with:
# docker run -v /local/path/to/output:/ppaxe/output:rw \
# ppaxe.docker -v -p ./papers.pmids -o ./papers.tbl -r ./papers.html
# the container working local folder is set to /ppaxe/output
# where the program will return by default the results.
# You must mount the container folder to your "/local/path/to/output"
# to keep the final results, with the docker "-v" switch.
#
FROM ubuntu:16.04
MAINTAINER Josep F Abril, [email protected]
MAINTAINER Sergio Castillo-Lara, [email protected]
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
build-essential \
ca-certificates \
gcc \
git \
libpq-dev \
make \
python-pip \
python2.7 \
python2.7-dev \
wget \
ssh \
unzip \
openjdk-8-jdk \
&& apt-get autoremove \
&& apt-get clean
RUN pip install -U "pycorenlp==0.3.0"
RUN pip install -U "scipy==0.17.0"
RUN pip install -U "sklearn==0.0"
RUN pip install -U "requests==2.4.3"
RUN pip install -U "scikit-learn==0.18.2"
RUN pip install -U "matplotlib==2.0.2"
RUN wget http://nlp.stanford.edu/software/stanford-corenlp-full-2017-06-09.zip \
&& unzip stanford-corenlp-full-2017-06-09.zip \
&& wget https://www.dropbox.com/s/ec3a4ey7s0k6qgy/FINAL-ner-model.AImed%2BMedTag%2BBioInfer.ser.gz?dl=0 \
-O /stanford-corenlp-full-2017-06-09/FINAL-ner-model.AImed+MedTag+BioInfer.ser.gz \
&& wget http://nlp.stanford.edu/software/stanford-english-corenlp-2017-06-09-models.jar \
-O /stanford-corenlp-full-2017-06-09/stanford-english-corenlp-2017-06-09-models.jar
RUN git --no-pager clone https://github.com/CompGenLabUB/ppaxe.git
RUN sed -i 's%\.\./%/stanford-corenlp-full-2017-06-09/%' \
/ppaxe/ppaxe/data/server.properties
WORKDIR /ppaxe
RUN wget https://www.dropbox.com/s/t6qcl19g536c0zu/RF_scikit.pkl?dl=0 \
-O ./ppaxe/data/RF_scikit.pkl \
&& pip install ./
RUN mkdir -vp /ppaxe/output \
&& chmod -v a+rwx /ppaxe/output
RUN \
echo '#!/bin/bash\n\
SPD="/stanford-corenlp-full-2017-06-09"\n\
java -mx1000m \\\n\
-cp $SPD/stanford-corenlp-3.8.0.jar:$SPD/stanford-english-corenlp-2017-06-09-models.jar \\\n\
edu.stanford.nlp.pipeline.StanfordCoreNLPServer \\\n\
-port 9000 \\\n\
-serverProperties /ppaxe/ppaxe/data/server.properties \\\n\
2> /dev/null 1>&2 &\n\
\n\
cd /ppaxe/output\n\
/ppaxe/bin/ppaxe $@\n' \
> /ppaxe/entrypoint.sh \
&& chmod +x /ppaxe/entrypoint.sh
# RUN cat /ppaxe/entrypoint.sh
WORKDIR /ppaxe/output
ENTRYPOINT ["/ppaxe/entrypoint.sh"]