2019-08-30 16:54:03 +00:00
|
|
|
# override this to "nvidia/cuda:10.1-runtime-ubi7" if cuda is desired
|
|
|
|
ARG BASE_IMAGE=registry.access.redhat.com/ubi7/ubi:latest
|
|
|
|
FROM ${BASE_IMAGE}
|
|
|
|
|
|
|
|
MAINTAINER Thingpedia Admins <thingpedia-admins@lists.stanford.edu>
|
|
|
|
|
|
|
|
# install basic tools
|
|
|
|
RUN yum -y install git wget gcc gcc-c++
|
|
|
|
|
|
|
|
# add epel repo
|
|
|
|
RUN wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -O /tmp/epel-release-latest-7.noarch.rpm
|
|
|
|
RUN yum -y install /tmp/epel-release-latest-7.noarch.rpm
|
|
|
|
|
|
|
|
# install python3
|
|
|
|
RUN yum -y install python36 \
|
|
|
|
python36-numpy \
|
|
|
|
python36-scipy \
|
|
|
|
python36-pip \
|
|
|
|
python36-devel
|
|
|
|
|
|
|
|
# download embeddings
|
2019-08-30 19:25:54 +00:00
|
|
|
RUN mkdir -p /usr/local/share/decanlp/embeddings
|
|
|
|
WORKDIR /usr/local/share/decanlp/embeddings
|
2019-08-30 16:54:03 +00:00
|
|
|
RUN for v in charNgram glove.840B.300d ; do \
|
|
|
|
for f in vectors table itos ; do \
|
|
|
|
wget -c https://oval.cs.stanford.edu/data/glove/${v}.txt.${f}.npy ; \
|
|
|
|
done ; \
|
|
|
|
done
|
|
|
|
|
2019-08-30 19:25:54 +00:00
|
|
|
# add user decanlp
|
|
|
|
RUN useradd -ms /bin/bash -r decanlp
|
|
|
|
USER decanlp
|
|
|
|
WORKDIR /home/decanlp
|
|
|
|
RUN ln -s /usr/local/share/decanlp/embeddings /home/decanlp/.embeddings
|
|
|
|
|
2019-08-30 16:54:03 +00:00
|
|
|
# copy source and install
|
|
|
|
USER root
|
|
|
|
COPY . /opt/decanlp
|
|
|
|
RUN pip3 install -e /opt/decanlp
|
|
|
|
|
|
|
|
USER decanlp
|
|
|
|
WORKDIR /home/decanlp
|
|
|
|
ENTRYPOINT ["decanlp"]
|