From 918e72da19482f7ca106bf1a4e927f39ba1f8867 Mon Sep 17 00:00:00 2001
From: Julian Rasch <jr662933@fh-muenster.de>
Date: Tue, 22 Oct 2024 20:30:14 +0000
Subject: [PATCH] pinned to correct versions

---
 Dockerfile       | 47 +++++++++++++----------------------------------
 requirements.txt |  6 ++++--
 2 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 6200f54..a6280ce 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,47 +1,26 @@
 FROM jupyter/datascience-notebook:hub-3.1.1
 
-# Use root to install packages and modify permissions
 USER root
 
-# Copy requirements and environment files to the container
 COPY requirements.txt environment.yml /tmp/
+RUN conda env update -q -f /tmp/environment.yml && \
+    /opt/conda/bin/pip install -r /tmp/requirements.txt && \
+    conda clean -y --all && \
+    conda env export -n "root" && \
+    jupyter lab build 
 
-# Update conda environment
-RUN conda env update -q -f /tmp/environment.yml
-
-# Install pip packages and avoid caching
-RUN /opt/conda/bin/pip install --no-cache-dir -r /tmp/requirements.txt
-
-# Fix permissions for the pip cache directory to avoid permission warnings
-RUN chown -R jovyan:users /home/jovyan/.cache
-
-# Ensure numpy and scikit-learn are compatible
-RUN /opt/conda/bin/pip install --no-cache-dir numpy==1.22.0 scikit-learn==1.2.2
-
-# Clean up conda cache
-RUN conda clean -y --all
-
-# Build Jupyter Lab
-RUN jupyter lab build
-
-# Install NLTK and SpaCy data
-RUN python -m nltk.downloader stopwords
-RUN python -m nltk.downloader wordnet
-RUN python -m spacy download en_core_web_sm
-
-# Copy and install custom packages
 COPY dash_proxy /tmp/dash_proxy/
-RUN pip install --no-cache-dir /tmp/dash_proxy/
+RUN pip install /tmp/dash_proxy/
 
 COPY llm_utils /llm_utils/
-RUN pip install --no-cache-dir /llm_utils/
-
-# Set environment variable for config path
+RUN pip install /llm_utils/
 ENV CONFIG_PATH=/home/jovyan/config.txt
 
-# Copy application files and adjust permissions for the jovyan user
 COPY app /dash/app/
-RUN chown -R jovyan:users /dash/app/
+RUN chown -R jovyan /dash/app/
 
-# Switch back to jovyan user
-USER jovyan
+# install some NLTK and spaCy data
+RUN python -m nltk.downloader stopwords
+RUN python -m nltk.downloader wordnet
+RUN python -m nltk.downloader punkt
+RUN python -m spacy download en_core_web_sm
diff --git a/requirements.txt b/requirements.txt
index 3592eea..2f01d76 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,8 +11,10 @@ plotly
 openai
 rapidfuzz
 nltk
-spacy
+spacy==3.4.4
 numpy==1.21.6
-scikit-learn
+scikit-learn==1.1.3
+
+pdfplumber
 python-dotenv
 
-- 
GitLab