docker: move embeddings to a shared directory

This way, the image can be used as a base image by almond-cloud
(which runs as a different user)
This commit is contained in:
Giovanni Campagna 2019-08-30 21:25:54 +02:00
parent ff311bd35b
commit fb72c84f73
1 changed files with 8 additions and 7 deletions

View File

@ -18,20 +18,21 @@ RUN yum -y install python36 \
python36-pip \
python36-devel
# add user decanlp
RUN useradd -ms /bin/bash -r decanlp
USER decanlp
WORKDIR /home/decanlp
# download embeddings
RUN mkdir -p .embeddings
WORKDIR .embeddings
RUN mkdir -p /usr/local/share/decanlp/embeddings
WORKDIR /usr/local/share/decanlp/embeddings
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
# 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
# copy source and install
USER root
COPY . /opt/decanlp