Skip to content

Commit

Permalink
Allow selecting installed optional deps via --build-arg
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Dec 21, 2021
1 parent 5c6af91 commit ad87d2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ RUN apt-get update \
WORKDIR /Annif
RUN pip install --upgrade pip --no-cache-dir

# Install all optional dependencies:
COPY setup.py README.md LICENSE.txt projects.cfg.dist /Annif/
RUN pip install .[dev,voikko,pycld3,fasttext,nn,omikuji,yake] --no-cache-dir
# Install dependencies for optional features.
ARG optional_dependencies=dev,voikko,pycld3,fasttext,nn,omikuji,yake
RUN echo "Installing dependencies for optional features: $optional_dependencies" \
&& pip install .[$optional_dependencies] --no-cache-dir

# Download nltk data (handle occasional timeout in with 3 tries):
RUN for i in 1 2 3; do python -m nltk.downloader punkt -d /usr/share/nltk_data && break || sleep 1; done
Expand Down

0 comments on commit ad87d2b

Please sign in to comment.