Skip to content

Commit

Permalink
Make docker build share dev and non-dev layers by moving ARG install_…
Browse files Browse the repository at this point in the history
…dev down (#12)

part of elifesciences/data-hub-issues#1045

Also removed unnecessary download of the small SpaCy model
  • Loading branch information
de-code authored Dec 18, 2024
1 parent e026dae commit 5946dfd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM python:3.8-slim
ARG install_dev=n

RUN apt-get update \
&& apt-get install --assume-yes --quiet --quiet \
Expand All @@ -16,14 +15,14 @@ RUN pip install --disable-pip-version-check -r requirements.spacy.txt

# download spaCy language models
RUN python -m spacy download en_core_web_lg
RUN if [ "${install_dev}" = "y" ]; then python -m spacy download en_core_web_sm; fi

COPY requirements.txt ./
RUN pip install --disable-pip-version-check \
-r requirements.spacy.txt \
-r requirements.txt

COPY requirements.dev.txt ./
ARG install_dev=n
RUN if [ "${install_dev}" = "y" ]; then \
pip install --disable-pip-version-check --user \
-r requirements.spacy.txt \
Expand Down

0 comments on commit 5946dfd

Please sign in to comment.