2019-11-02 00:06:57 +00:00
|
|
|
# override this to "nvidia/cuda:10.1-runtime-ubi8" if cuda is desired
|
|
|
|
ARG BASE_IMAGE=registry.access.redhat.com/ubi8/ubi:latest
|
2019-08-30 16:54:03 +00:00
|
|
|
FROM ${BASE_IMAGE}
|
|
|
|
|
|
|
|
MAINTAINER Thingpedia Admins <thingpedia-admins@lists.stanford.edu>
|
|
|
|
|
2019-11-02 00:06:57 +00:00
|
|
|
# install basic tools and python3
|
|
|
|
RUN dnf -y install git wget gcc gcc-c++ \
|
|
|
|
python3 \
|
|
|
|
python3-numpy \
|
|
|
|
python3-scipy \
|
|
|
|
python3-pip \
|
|
|
|
python3-devel \
|
|
|
|
&& rm -fr /var/cache/dnf
|
2019-08-30 16:54:03 +00:00
|
|
|
|
|
|
|
# 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
|
2019-11-02 00:06:57 +00:00
|
|
|
RUN pip3 install -e /opt/decanlp && rm -fr /root/.cache
|
2019-08-30 16:54:03 +00:00
|
|
|
|
|
|
|
USER decanlp
|
|
|
|
WORKDIR /home/decanlp
|
|
|
|
ENTRYPOINT ["decanlp"]
|