From fb72c84f73085a2fa04fe13afbb37631a0b089e3 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 30 Aug 2019 21:25:54 +0200 Subject: [PATCH] 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) --- dockerfiles/Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dockerfiles/Dockerfile b/dockerfiles/Dockerfile index 54efe380..d0245d4b 100644 --- a/dockerfiles/Dockerfile +++ b/dockerfiles/Dockerfile @@ -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