-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
65 lines (53 loc) · 1.68 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
FROM ubuntu
ENV CORENLP_URL=http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip \
CORENLP_HOME=/corenlp \
QUASIMODO_DATA=/quasimodo_data\
REDIS_URL=redis://redis:6379/0
RUN apt -yqq update && \
apt -yqq upgrade && \
apt -yqq install python3 \
git \
openjdk-8-jdk \
python3-setuptools \
python3-dev \
build-essential \
python3-pip \
unzip \
wget \
locales \
&& rm -rf /var/lib/apt/lists/*
# Set the locale
RUN locale-gen en_US.UTF-8
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
# Install CORENLP
RUN wget $CORENLP_URL -O corenlp.zip && \
unzip corenlp.zip && \
rm corenlp.zip && \
mv stanford* $CORENLP_HOME
# Create data directories
RUN mkdir $QUASIMODO_DATA && \
mkdir $QUASIMODO_DATA/properties && \
mkdir $QUASIMODO_DATA/question2statement
RUN pip3 install --upgrade pip && \
pip3 install spacy nltk && \
python3 -m spacy download en_core_web_sm && \
python3 -m spacy download en_core_web_lg && \
python3 -m nltk.downloader all
# Invalidate Cache from here
ADD https://time.is/ /tmp/bustcache
# Get code
RUN git clone https://github.com/Aunsiels/CSK.git
# Install python libraries
RUN cd CSK && \
pip3 install -r requirements.txt
# Send config file
COPY quasimodo/parameters_docker.tsv CSK/quasimodo/parameters.tsv
# Send data
COPY quasimodo/data/properties/ $QUASIMODO_DATA/properties/
# Flickr API
COPY keys.py /usr/local/lib/python3.6/dist-packages/flickr_api/keys.py
CMD cd CSK && rq worker -u $REDIS_URL quasimodo-tasks