From e1cc92c4656abd485bf1dbb3d72decda318cccd9 Mon Sep 17 00:00:00 2001 From: rakesh-krishna-a-s Date: Thu, 10 Aug 2023 15:51:07 +0530 Subject: [PATCH] download nltk files in build step instead of during the start of the application --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 86f98bf95..60034a922 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ COPY requirements.txt . RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt +RUN python -m nltk.downloader averaged_perceptron_tagger punkt + COPY . . RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh @@ -29,5 +31,6 @@ RUN apt-get update && \ COPY --from=compile-image /opt/venv /opt/venv COPY --from=compile-image /app /app +COPY --from=compile-image /root/nltk_data /root/nltk_data ENV PATH="/opt/venv/bin:$PATH"