From 4c755b72528708fe288490b131457891b1f30bb6 Mon Sep 17 00:00:00 2001 From: ckertam Date: Sat, 9 Dec 2023 21:24:54 +0300 Subject: [PATCH] Change dockerfile for NLTK Data pre download #238 --- backend/Dockerfile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index bbb5b568..77094093 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -8,17 +8,18 @@ WORKDIR /backend COPY requirements.txt . -RUN : \ - && apt-get update -y \ - && export DEBIAN_FRONTEND=noninteractive \ - && apt-get install -y --no-install-recommends \ +# Install system dependencies for NLTK and GDAL +RUN apt-get update -y && \ + export DEBIAN_FRONTEND=noninteractive && \ + apt-get install -y --no-install-recommends \ binutils libproj-dev gdal-bin \ - && apt-get autoremove -y \ - && apt-get clean -y \ - && rm -rf /var/lib/apt/lists/* \ - && python -m pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir -r requirements.txt \ - && : + gcc g++ && \ + apt-get autoremove -y && \ + apt-get clean -y && \ + rm -rf /var/lib/apt/lists/* && \ + python -m pip install --no-cache-dir --upgrade pip && \ + pip install --no-cache-dir -r requirements.txt && \ + python -m nltk.downloader punkt averaged_perceptron_tagger wordnet stopwords COPY manage.py . @@ -28,6 +29,4 @@ COPY user/ ./user EXPOSE 8000 - - CMD python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000