From 9982ecda91b6f6575f58336dbd007199c823ca21 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Tue, 5 Aug 2025 13:03:37 -0400 Subject: [PATCH 1/2] move Python package installations to requirements file --- Dockerfile | 34 ++++------------------------ dependencies/python/requirements.txt | 29 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 dependencies/python/requirements.txt diff --git a/Dockerfile b/Dockerfile index bbacbd6..b35bc12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,40 +18,14 @@ RUN apt-get update -qq && apt-get install -y \ # Dependencies for OpenCV RUN apt-get install -y libgl1 -# Install additional Python packages -RUN pip3 install --no-cache-dir \ - flask_sqlalchemy \ - numpy \ - pandas \ - passlib \ - plotly \ - pytz \ - cachelib \ - cffi \ - inflect \ - emoji \ - pyfiglet \ - multipledispatch \ - Pillow==10.4.0 \ - tabulate \ - validators \ - validator-collection \ - fpdf2==2.8.2 - -# Install ML packages for CS50 AI -RUN pip3 install --no-cache-dir \ - nltk \ - opencv-python \ - scikit-learn \ - tf-nightly \ - transformers==4.35.0 +# Install Python packages from requirements file +COPY dependencies/python/requirements.txt /tmp/requirements.txt +RUN pip3 install --no-cache-dir -r /tmp/requirements.txt && \ + rm /tmp/requirements.txt # Install nltk data RUN python3 -c "import nltk; nltk.download('punkt_tab', download_dir='/usr/share/nltk_data/')" -# Install CS50 Python packages -RUN pip3 install cs50 --upgrade --no-cache-dir - # Install R and dependencies for tidyverse library RUN apt-get update -qq && apt-get install -y \ automake \ diff --git a/dependencies/python/requirements.txt b/dependencies/python/requirements.txt new file mode 100644 index 0000000..135c03b --- /dev/null +++ b/dependencies/python/requirements.txt @@ -0,0 +1,29 @@ +# Additional Python packages +cachelib==0.13.0 +cffi==1.17.1 +emoji==2.14.1 +Flask-SQLAlchemy==3.1.1 +fpdf2==2.8.3 +inflect==7.5.0 +multipledispatch==1.0.0 +numpy==2.3.2 +pandas==2.3.1 +passlib==1.7.4 +Pillow==11.3.0 +plotly==6.2.0 +pyfiglet==1.0.3 +pytz==2025.2 +tabulate==0.9.0 +validator-collection==1.5.0 +validators==0.35.0 + +# ML packages for CS50 AI +nltk==3.9.1 +opencv-python +scikit-learn==1.7.1 +tf-nightly==2.21.0.dev20250801 +tf-keras +transformers==4.35.0 + +# CS50 Python packages +cs50==9.4.0 \ No newline at end of file From c67f8b418214503ab88920e512c3d7f07fb246c0 Mon Sep 17 00:00:00 2001 From: Rongxin Liu Date: Tue, 5 Aug 2025 13:06:49 -0400 Subject: [PATCH 2/2] update requirements.txt to include Flask and Flask-Session --- dependencies/python/requirements.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dependencies/python/requirements.txt b/dependencies/python/requirements.txt index 135c03b..937a118 100644 --- a/dependencies/python/requirements.txt +++ b/dependencies/python/requirements.txt @@ -2,6 +2,8 @@ cachelib==0.13.0 cffi==1.17.1 emoji==2.14.1 +Flask==3.1.1 +Flask-Session==0.8.0 Flask-SQLAlchemy==3.1.1 fpdf2==2.8.3 inflect==7.5.0 @@ -17,13 +19,10 @@ tabulate==0.9.0 validator-collection==1.5.0 validators==0.35.0 -# ML packages for CS50 AI +# CS50 AI nltk==3.9.1 opencv-python scikit-learn==1.7.1 tf-nightly==2.21.0.dev20250801 tf-keras -transformers==4.35.0 - -# CS50 Python packages -cs50==9.4.0 \ No newline at end of file +transformers==4.35.0 \ No newline at end of file