Rohan Kataria commited on
Commit
43c61aa
·
1 Parent(s): dc0d6c9

embedding and model

Browse files
Files changed (49) hide show
  1. .history/Dockerfile_20240310014704 +37 -0
  2. .history/Dockerfile_20240310014908 +44 -0
  3. .history/Dockerfile_20240310014955 +48 -0
  4. .history/Dockerfile_20240310015011 +42 -0
  5. .history/Dockerfile_20240310015012 +42 -0
  6. .history/Dockerfile_20240310015021 +42 -0
  7. .history/Dockerfile_20240310121246 +19 -0
  8. .history/Dockerfile_20240310121443 +25 -0
  9. .history/Dockerfile_20240310121634 +25 -0
  10. .history/Dockerfile_20240310121931 +25 -0
  11. .history/Dockerfile_20240310121948 +25 -0
  12. .history/Dockerfile_20240310122013 +25 -0
  13. .history/Dockerfile_20240310122017 +25 -0
  14. .history/Dockerfile_20240310122018 +25 -0
  15. .history/Dockerfile_20240310122020 +25 -0
  16. .history/Dockerfile_20240310122058 +25 -0
  17. .history/Dockerfile_20240310122106 +25 -0
  18. .history/Dockerfile_20240310122300 +25 -0
  19. .history/Dockerfile_20240310122456 +25 -0
  20. .history/Dockerfile_20240310122851 +47 -0
  21. .history/Dockerfile_20240310123010 +36 -0
  22. .history/Dockerfile_20240310123131 +36 -0
  23. .history/Dockerfile_20240310123224 +36 -0
  24. .history/Dockerfile_20240310123319 +36 -0
  25. .history/Dockerfile_20240310123825 +36 -0
  26. .history/Dockerfile_20240310123836 +36 -0
  27. .history/Dockerfile_20240310124558 +36 -0
  28. .history/Dockerfile_20240310124839 +20 -0
  29. .history/Dockerfile_20240310125002 +20 -0
  30. .history/Dockerfile_20240310125005 +20 -0
  31. .history/Dockerfile_20240310125425 +20 -0
  32. .history/Dockerfile_20240310125557 +20 -0
  33. .history/Dockerfile_20240310125612 +20 -0
  34. .history/Dockerfile_20240310130057 +23 -0
  35. .history/Dockerfile_20240310130108 +23 -0
  36. .history/Dockerfile_20240310130420 +23 -0
  37. .history/Dockerfile_20240310130429 +22 -0
  38. .history/Dockerfile_20240310203811 +22 -0
  39. .history/Dockerfile_20240310204031 +44 -0
  40. .history/Dockerfile_20240310204542 +45 -0
  41. .history/requirements_20240310012013.txt +5 -0
  42. .history/requirements_20240310124533.txt +5 -0
  43. .history/requirements_20240310124625.txt +5 -0
  44. .history/requirements_20240310124727.txt +5 -0
  45. .history/src/main_20240310011128.py +143 -0
  46. .history/src/main_20240310203826.py +143 -0
  47. Dockerfile +39 -13
  48. requirements.txt +2 -2
  49. src/main.py +1 -1
.history/Dockerfile_20240310014704 ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create app directory
5
+ WORKDIR /app
6
+
7
+ # Copy the Python requirements file and system packages list
8
+ COPY ./requirements.txt /app/requirements.txt
9
+
10
+ # Install system dependencies
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ build-essential \
13
+ libgomp1 \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Install Python dependencies
17
+ RUN pip install --upgrade pip setuptools wheel && \
18
+ pip install --no-cache-dir -r /app/requirements.txt
19
+
20
+ # Create a non-root user
21
+ RUN useradd -m -u 1000 user
22
+ USER user
23
+ ENV HOME /home/user
24
+ ENV PATH $HOME/.local/bin:$PATH
25
+
26
+ # Copy the application to the user's home directory
27
+ WORKDIR $HOME
28
+ COPY --chown=user:user . $HOME/app
29
+
30
+ # Set the working directory to the app directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Expose the Streamlit port
34
+ EXPOSE 8501
35
+
36
+ # Run the Streamlit application with additional configurations for cloud deployment
37
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.headless=true", "--server.enableCORS=false", "--server.enableXsrfProtection=false", "--server.fileWatcherType=none"]
.history/Dockerfile_20240310014908 ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ # If you have system dependencies listed in a packages.txt file, uncomment the next line
10
+ # COPY ./packages.txt /app/packages.txt
11
+
12
+ # Install system dependencies
13
+ # If you're using packages.txt, uncomment the following RUN command and remove the subsequent one
14
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
15
+ RUN apt-get update && apt-get install -y \
16
+ build-essential \
17
+ libgomp1 \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
21
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
22
+
23
+ # Create a non-root user and switch to it
24
+ RUN useradd -m user
25
+ USER user
26
+ ENV HOME /home/user
27
+ ENV PATH $HOME/.local/bin:$PATH
28
+
29
+ # Copy the application source code to the container (as the non-root user)
30
+ COPY --chown=user:user . $HOME/app
31
+
32
+ # Set the working directory to the app directory
33
+ WORKDIR $HOME/app
34
+
35
+ # Expose the port the app runs on
36
+ EXPOSE 8501
37
+
38
+ # Define the command to run the app
39
+ CMD streamlit run app.py \
40
+ --server.headless true \
41
+ --server.address 0.0.0.0 \
42
+ --server.enableCORS false \
43
+ --server.enableXsrfProtection false \
44
+ --server.fileWatcherType none
.history/Dockerfile_20240310014955 ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+
13
+ # If you have system dependencies listed in a packages.txt file, uncomment the next line
14
+ # COPY ./packages.txt /app/packages.txt
15
+
16
+ # Install system dependencies
17
+ # If you're using packages.txt, uncomment the following RUN command and remove the subsequent one
18
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
19
+ RUN apt-get update && apt-get install -y \
20
+ build-essential \
21
+ libgomp1 \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
25
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
26
+
27
+ # Create a non-root user and switch to it
28
+ RUN useradd -m user
29
+ USER user
30
+ ENV HOME /home/user
31
+ ENV PATH $HOME/.local/bin:$PATH
32
+
33
+ # Copy the application source code to the container (as the non-root user)
34
+ COPY --chown=user:user . $HOME/app
35
+
36
+ # Set the working directory to the app directory
37
+ WORKDIR $HOME/app
38
+
39
+ # Expose the port the app runs on
40
+ EXPOSE 8501
41
+
42
+ # Define the command to run the app
43
+ CMD streamlit run app.py \
44
+ --server.headless true \
45
+ --server.address 0.0.0.0 \
46
+ --server.enableCORS false \
47
+ --server.enableXsrfProtection false \
48
+ --server.fileWatcherType none
.history/Dockerfile_20240310015011 ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Create a non-root user and switch to it
22
+ RUN useradd -m user
23
+ USER user
24
+ ENV HOME /home/user
25
+ ENV PATH $HOME/.local/bin:$PATH
26
+
27
+ # Copy the application source code to the container (as the non-root user)
28
+ COPY --chown=user:user . $HOME/app
29
+
30
+ # Set the working directory to the app directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Expose the port the app runs on
34
+ EXPOSE 8501
35
+
36
+ # Define the command to run the app
37
+ CMD streamlit run app.py \
38
+ --server.headless true \
39
+ --server.address 0.0.0.0 \
40
+ --server.enableCORS false \
41
+ --server.enableXsrfProtection false \
42
+ --server.fileWatcherType none
.history/Dockerfile_20240310015012 ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Create a non-root user and switch to it
22
+ RUN useradd -m user
23
+ USER user
24
+ ENV HOME /home/user
25
+ ENV PATH $HOME/.local/bin:$PATH
26
+
27
+ # Copy the application source code to the container (as the non-root user)
28
+ COPY --chown=user:user . $HOME/app
29
+
30
+ # Set the working directory to the app directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Expose the port the app runs on
34
+ EXPOSE 8501
35
+
36
+ # Define the command to run the app
37
+ CMD streamlit run app.py \
38
+ --server.headless true \
39
+ --server.address 0.0.0.0 \
40
+ --server.enableCORS false \
41
+ --server.enableXsrfProtection false \
42
+ --server.fileWatcherType none
.history/Dockerfile_20240310015021 ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Create a non-root user and switch to it
22
+ RUN useradd -m user
23
+ USER user
24
+ ENV HOME /home/user
25
+ ENV PATH $HOME/.local/bin:$PATH
26
+
27
+ # Copy the application source code to the container (as the non-root user)
28
+ COPY --chown=user:user . $HOME/app
29
+
30
+ # Set the working directory to the app directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Expose the port the app runs on
34
+ EXPOSE 8501
35
+
36
+ # Define the command to run the app
37
+ CMD streamlit run app.py \
38
+ --server.headless true \
39
+ --server.address 0.0.0.0 \
40
+ --server.enableCORS false \
41
+ --server.enableXsrfProtection false \
42
+ --server.fileWatcherType none
.history/Dockerfile_20240310121246 ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
13
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
14
+
15
+ # Expose the port the app runs on
16
+ EXPOSE 8501
17
+
18
+ # Define the command to run the app
19
+ CMD streamlit run app.py
.history/Dockerfile_20240310121443 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run app.py
.history/Dockerfile_20240310121634 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src /app/src
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app/app.py
.history/Dockerfile_20240310121931 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src/ /app/src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app/app.py --server.address 0.0.0.0
.history/Dockerfile_20240310121948 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /app
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src/ /app/src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app/app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122013 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /requirements.txt
9
+ COPY ./app.py /app.py
10
+ COPY ./src/ /src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app/app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122017 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /requirements.txt
9
+ COPY ./app.py /app.py
10
+ COPY ./src/ /src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122018 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /requirements.txt
9
+ COPY ./app.py /app.py
10
+ COPY ./src/ /src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122020 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /requirements.txt
9
+ COPY ./app.py /app.py
10
+ COPY ./src/ /src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122058 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /requirements.txt
9
+ COPY ./app.py /app.py
10
+ COPY ./src/ /src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122106 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /requirements.txt
9
+ COPY ./app.py /app.py
10
+ COPY ./src/ /src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122300 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src/ /app/src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122456 ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set a working directory for the application
5
+ WORKDIR /
6
+
7
+ # Copy the Python and system requirements files to the container
8
+ COPY ./requirements.txt /app/requirements.txt
9
+ COPY ./app.py /app/app.py
10
+ COPY ./src/ /app/src/
11
+
12
+ # RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
13
+ RUN apt-get update && apt-get install -y \
14
+ build-essential \
15
+ libgomp1 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Upgrade pip, setuptools, and wheel, then install Python dependencies
19
+ RUN pip install --upgrade pip setuptools wheel && pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Expose the port the app runs on
22
+ EXPOSE 8501
23
+
24
+ # Define the command to run the app
25
+ CMD streamlit run /app/app.py --server.address 0.0.0.0
.history/Dockerfile_20240310122851 ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
+
4
+ # Set a working directory for copying requirements initially
5
+ WORKDIR /app
6
+
7
+ # Copy only the requirements file, to cache the pip install step
8
+ COPY ./requirements.txt /app/requirements.txt
9
+
10
+ # Install Python dependencies
11
+ RUN pip install --no-cache-dir -r /app/requirements.txt
12
+
13
+ # Copy specific application files to the container
14
+ COPY ./app.py /app/app.py
15
+ COPY ./src /app/src
16
+
17
+ # Create a non-root user 'appuser' with home directory /home/appuser
18
+ # No need to specify USER ID unless it's required for your use case
19
+ RUN useradd -m appuser
20
+
21
+ # Switch to the non-root user
22
+ USER appuser
23
+
24
+ # Set environment variables for the non-root user
25
+ ENV HOME /home/appuser
26
+ ENV PATH $HOME/.local/bin:$PATH
27
+
28
+ # Set the working directory to the non-root user's home directory
29
+ WORKDIR $HOME
30
+
31
+ # Create an 'app' directory under the non-root user's home directory and change workdir to it
32
+ RUN mkdir app
33
+ WORKDIR $HOME/app
34
+
35
+ # Copy the application files from host to container, ensuring correct ownership
36
+ COPY --chown=appuser:appuser . $HOME/app
37
+
38
+ # Since we've already copied app.py and src/ before changing the user,
39
+ # ensure they are copied into the correct final directory and with correct ownership
40
+ COPY --chown=appuser:appuser /app/app.py $HOME/app/
41
+ COPY --chown=appuser:appuser /app/src/ $HOME/app/src/
42
+
43
+ # Expose the port the app runs on
44
+ EXPOSE 8501
45
+
46
+ # Define the command to run the app
47
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310123010 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./requirements.txt /app/requirements.txt
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Switch to the non-root user
17
+ USER appuser
18
+
19
+ # Set environment variables for the non-root user
20
+ ENV HOME /home/appuser
21
+
22
+ # Set the working directory to the non-root user's home directory
23
+ WORKDIR $HOME
24
+
25
+ # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ RUN mkdir app
27
+ WORKDIR $HOME/app
28
+
29
+ # Copy the application files from host to container, ensuring correct ownership
30
+ COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310123131 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.11-slim
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app/
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Switch to the non-root user
17
+ USER appuser
18
+
19
+ # Set environment variables for the non-root user
20
+ ENV HOME /home/appuser
21
+
22
+ # Set the working directory to the non-root user's home directory
23
+ WORKDIR $HOME
24
+
25
+ # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ RUN mkdir app
27
+ WORKDIR $HOME/app
28
+
29
+ # Copy the application files from host to container, ensuring correct ownership
30
+ COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310123224 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app/
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Switch to the non-root user
17
+ USER appuser
18
+
19
+ # Set environment variables for the non-root user
20
+ ENV HOME /home/appuser
21
+
22
+ # Set the working directory to the non-root user's home directory
23
+ WORKDIR $HOME
24
+
25
+ # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ RUN mkdir app
27
+ WORKDIR $HOME/app
28
+
29
+ # Copy the application files from host to container, ensuring correct ownership
30
+ COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310123319 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app/
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Switch to the non-root user
17
+ USER appuser
18
+
19
+ # Set environment variables for the non-root user
20
+ ENV HOME /home/appuser
21
+
22
+ # Set the working directory to the non-root user's home directory
23
+ WORKDIR $HOME
24
+
25
+ # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ RUN mkdir app
27
+ WORKDIR $HOME/app
28
+
29
+ # Copy the application files from host to container, ensuring correct ownership
30
+ COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310123825 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app/
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # # Switch to the non-root user
17
+ # USER appuser
18
+
19
+ # # Set environment variables for the non-root user
20
+ # ENV HOME /home/appuser
21
+
22
+ # # Set the working directory to the non-root user's home directory
23
+ # WORKDIR $HOME
24
+
25
+ # # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ # RUN mkdir app
27
+ # WORKDIR $HOME/app
28
+
29
+ # # Copy the application files from host to container, ensuring correct ownership
30
+ # COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310123836 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app/
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # # Switch to the non-root user
17
+ # USER appuser
18
+
19
+ # # Set environment variables for the non-root user
20
+ # ENV HOME /home/appuser
21
+
22
+ # # Set the working directory to the non-root user's home directory
23
+ # WORKDIR $HOME
24
+
25
+ # # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ # RUN mkdir app
27
+ # WORKDIR $HOME/app
28
+
29
+ # # Copy the application files from host to container, ensuring correct ownership
30
+ # COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py"]
.history/Dockerfile_20240310124558 ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app/
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # # Switch to the non-root user
17
+ # USER appuser
18
+
19
+ # # Set environment variables for the non-root user
20
+ # ENV HOME /home/appuser
21
+
22
+ # # Set the working directory to the non-root user's home directory
23
+ # WORKDIR $HOME
24
+
25
+ # # Create an 'app' directory under the non-root user's home directory and change workdir to it
26
+ # RUN mkdir app
27
+ # WORKDIR $HOME/app
28
+
29
+ # # Copy the application files from host to container, ensuring correct ownership
30
+ # COPY --chown=appuser:appuser ./ $HOME/app/
31
+
32
+ # Expose the port the app runs on
33
+ EXPOSE 8501
34
+
35
+ # Define the command to run the app
36
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=8501"]
.history/Dockerfile_20240310124839 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Expose the port the app runs on
17
+ EXPOSE 8501
18
+
19
+ # Define the command to run the app
20
+ CMD ["streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=8501"]
.history/Dockerfile_20240310125002 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Expose the port the app runs on
17
+ EXPOSE 8501
18
+
19
+ # Define the command to run the app
20
+ CMD streamlit run app.py
.history/Dockerfile_20240310125005 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Expose the port the app runs on
17
+ EXPOSE 8501
18
+
19
+ # Define the command to run the app
20
+ CMD streamlit run app.py
.history/Dockerfile_20240310125425 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Expose the port the app runs on
17
+ EXPOSE 8501
18
+
19
+ # Define the command to run the app
20
+ CMD python streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310125557 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Expose the port the app runs on
17
+ EXPOSE 8501
18
+
19
+ # Define the command to run the app
20
+ CMD streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310125612 ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+
16
+ # Expose the port the app runs on
17
+ EXPOSE 8501
18
+
19
+ # Define the command to run the app
20
+ CMD streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310130057 ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ RUN pip install "langchain[docarray]"
16
+ RUN pip3 install "langchain[docarray]"
17
+
18
+
19
+ # Expose the port the app runs on
20
+ EXPOSE 8501
21
+
22
+ # Define the command to run the app
23
+ CMD streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310130108 ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ RUN pip install "langchain[docarray]"
16
+ RUN pip3 install "langchain[docarray]"
17
+
18
+
19
+ # Expose the port the app runs on
20
+ EXPOSE 8501
21
+
22
+ # Define the command to run the app
23
+ CMD streamlit run app.py --server.address=0.0.0.0:8501
.history/Dockerfile_20240310130420 ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ RUN pip install "langchain[docarray]"
16
+ RUN pip3 install "langchain[docarray]"
17
+
18
+
19
+ # Expose the port the app runs on
20
+ EXPOSE 8501
21
+
22
+ # Define the command to run the app
23
+ CMD streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310130429 ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ RUN pip install "langchain[docarray]"
16
+ RUN pip3 install "langchain[docarray]"
17
+
18
+ # Expose the port the app runs on
19
+ EXPOSE 8501
20
+
21
+ # Define the command to run the app
22
+ CMD streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310203811 ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user 'appuser' with home directory /home/appuser
5
+ RUN useradd -m appuser
6
+
7
+ # Set a working directory for copying requirements initially as root
8
+ WORKDIR /app
9
+
10
+ # Copy only the requirements file, to cache the pip install step
11
+ COPY ./ /app
12
+
13
+ # Install Python dependencies
14
+ RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ RUN pip install "langchain[docarray]"
16
+ RUN pip3 install "langchain[docarray]"
17
+
18
+ # Expose the port the app runs on
19
+ EXPOSE 8501
20
+
21
+ # Define the command to run the app
22
+ CMD streamlit run app.py --server.address=0.0.0.0
.history/Dockerfile_20240310204031 ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # # Use an official Python runtime as a parent image
2
+ # FROM python:3.9
3
+
4
+ # # Create a non-root user 'appuser' with home directory /home/appuser
5
+ # RUN useradd -m appuser
6
+
7
+ # # Set a working directory for copying requirements initially as root
8
+ # WORKDIR /app
9
+
10
+ # # Copy only the requirements file, to cache the pip install step
11
+ # COPY ./ /app
12
+
13
+ # # Install Python dependencies
14
+ # RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ # RUN pip install "langchain[docarray]"
16
+ # RUN pip3 install "langchain[docarray]"
17
+
18
+ # # Expose the port the app runs on
19
+ # EXPOSE 8501
20
+
21
+ # # Define the command to run the app
22
+ # CMD streamlit run app.py --server.address=0.0.0.0
23
+
24
+
25
+ FROM python:3.9-slim
26
+
27
+ WORKDIR /app
28
+
29
+ RUN apt-get update && apt-get install -y \
30
+ build-essential \
31
+ curl \
32
+ software-properties-common \
33
+ git \
34
+ && rm -rf /var/lib/apt/lists/*
35
+
36
+ COPY ./ /app
37
+
38
+ RUN pip3 install -r requirements.txt
39
+
40
+ EXPOSE 8501
41
+
42
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
43
+
44
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
.history/Dockerfile_20240310204542 ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # # Use an official Python runtime as a parent image
2
+ # FROM python:3.9
3
+
4
+ # # Create a non-root user 'appuser' with home directory /home/appuser
5
+ # RUN useradd -m appuser
6
+
7
+ # # Set a working directory for copying requirements initially as root
8
+ # WORKDIR /app
9
+
10
+ # # Copy only the requirements file, to cache the pip install step
11
+ # COPY ./ /app
12
+
13
+ # # Install Python dependencies
14
+ # RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ # RUN pip install "langchain[docarray]"
16
+ # RUN pip3 install "langchain[docarray]"
17
+
18
+ # # Expose the port the app runs on
19
+ # EXPOSE 8501
20
+
21
+ # # Define the command to run the app
22
+ # CMD streamlit run app.py --server.address=0.0.0.0
23
+
24
+
25
+ FROM python:3.9-slim
26
+
27
+ WORKDIR /app
28
+
29
+ RUN apt-get update && apt-get install -y \
30
+ build-essential \
31
+ curl \
32
+ software-properties-common \
33
+ git \
34
+ && rm -rf /var/lib/apt/lists/*
35
+
36
+ COPY ./ /app
37
+
38
+ RUN pip3 install -r requirements.txt
39
+ RUN pip3 install 'langchain[docarray]'
40
+
41
+ EXPOSE 8501
42
+
43
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
44
+
45
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
.history/requirements_20240310012013.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ streamlit
2
+ langchain==0.0.305
3
+ langchain[docarray]
4
+ tiktoken
5
+ openai
.history/requirements_20240310124533.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ streamlit
2
+ langchain==0.0.305
3
+ "langchain[docarray]"
4
+ tiktoken
5
+ openai
.history/requirements_20240310124625.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ streamlit
2
+ langchain==0.0.305
3
+ 'langchain[docarray]'
4
+ tiktoken
5
+ openai
.history/requirements_20240310124727.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ openai
2
+ streamlit
3
+ langchain==0.0.305
4
+ langchain[docarray]
5
+ tiktoken
.history/src/main_20240310011128.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import openai
3
+ import sys
4
+ sys.path.append('../..')
5
+ from langchain.embeddings.openai import OpenAIEmbeddings
6
+ from langchain.text_splitter import CharacterTextSplitter, RecursiveCharacterTextSplitter
7
+ from langchain.vectorstores import DocArrayInMemorySearch
8
+ from langchain.document_loaders import TextLoader
9
+ from langchain.chains import RetrievalQA, ConversationalRetrievalChain
10
+ from langchain.memory import ConversationBufferMemory
11
+ from langchain.chat_models import ChatOpenAI
12
+ from langchain.document_loaders import TextLoader
13
+ from langchain.document_loaders import GitLoader
14
+ from langchain.llms import OpenAI
15
+ from langchain.memory import ConversationBufferMemory, ConversationBufferWindowMemory
16
+ from langchain.vectorstores import Chroma
17
+ from langchain.embeddings.openai import OpenAIEmbeddings
18
+ from langchain.prompts import PromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate, AIMessagePromptTemplate, ChatPromptTemplate
19
+ import datetime
20
+ import shutil
21
+
22
+
23
+ # Function to load the data from github using langchain with string type url, string type branch, string type file_filter
24
+ def loader(url: str, branch: str, file_filter: str):
25
+ repo_path = "./github_repo"
26
+ if os.path.exists(repo_path):
27
+ shutil.rmtree(repo_path)
28
+
29
+ loader = GitLoader(
30
+ clone_url= url,
31
+ repo_path="./github_repo/",
32
+ branch=branch,
33
+ file_filter=lambda file_path: file_path.endswith(tuple(file_filter.split(','))) # Filter out files in Data but whole repo is cloned
34
+ )
35
+
36
+ data = loader.load()
37
+ return data
38
+
39
+
40
+ #Function to split the data into chunks using recursive character text splitter
41
+ def split_data(data):
42
+ splitter = RecursiveCharacterTextSplitter(
43
+ chunk_size=1000,
44
+ chunk_overlap=150,
45
+ length_function=len, # Function to measure the length of chunks while splitting
46
+ add_start_index=True # Include the starting position of each chunk in metadata
47
+ )
48
+ chunks = splitter.split_documents(data)
49
+ return chunks
50
+
51
+ #Function to ingest the chunks into a vectorstore of doc
52
+ def ingest_chunks(chunks):
53
+ embedding = OpenAIEmbeddings(
54
+ # deployment="your-embeddings-deployment-name",
55
+ model="codellama",
56
+ openai_api_base="https://thewise-ollama-server.hf.space",
57
+ # openai_api_type="azure",
58
+ openai_api_key='nothing'
59
+ )
60
+ vector_store = DocArrayInMemorySearch.from_documents(chunks, embedding)
61
+
62
+ repo_path = "./github_repo"
63
+ if os.path.exists(repo_path):
64
+ shutil.rmtree(repo_path)
65
+
66
+ return vector_store
67
+
68
+ #Retreival function to get the data from the database and reply to the user
69
+ def retreival(vector_store, k):
70
+ #Creating LLM
71
+ llm = ChatOpenAI(model='codellama', temperature=0, openai_api_base='https://thewise-ollama-server.hf.space', openai_api_key='nothing')
72
+
73
+ # Define the system message template
74
+ #Adding CHAT HISTORY to the System template explicitly because mainly Chat history goes to Condense the Human Question with Backround (Not template), but System template goes straight the LLM Chain
75
+ #Explicitly adding chat history to access previous chats and answer "what is my previous question?"
76
+ #Great thing this also sends the chat history to the LLM Model along with the context and question
77
+ system_template = """You're a code summarisation assistant. Given the following extracted parts of a long document as "CONTEXT" create a final answer.
78
+ If you don't know the answer, just say that you don't know. Don't try to make up an answer.
79
+ Only If asked to create a "DIAGRAM" for code use "MERMAID SYNTAX LANGUAGE" in your answer from "CONTEXT" and "CHAT HISTORY" with a short explanation of diagram.
80
+ CONTEXT: {context}
81
+ =======
82
+ CHAT HISTORY: {chat_history}
83
+ =======
84
+ FINAL ANSWER:"""
85
+
86
+ human_template = """{question}"""
87
+
88
+ # ai_template = """
89
+ # FINAL ANSWER:"""
90
+
91
+ # Create the chat prompt templates
92
+ messages = [
93
+ SystemMessagePromptTemplate.from_template(system_template),
94
+ HumanMessagePromptTemplate.from_template(human_template)
95
+ # AIMessagePromptTemplate.from_template(ai_template)
96
+ ]
97
+
98
+ PROMPT = ChatPromptTemplate.from_messages(messages)
99
+
100
+ #Creating memory
101
+ # memory = ConversationBufferMemory(
102
+ # memory_key="chat_history",
103
+ # input_key="question",
104
+ # output_key="answer",
105
+ # return_messages=True)
106
+
107
+ memory = ConversationBufferWindowMemory(
108
+ memory_key="chat_history",
109
+ input_key="question",
110
+ output_key="answer",
111
+ return_messages=True,
112
+ k=5)
113
+
114
+ #Creating the retriever, this can also be a contextual compressed retriever
115
+ retriever = vector_store.as_retriever(search_type="similarity", search_kwargs={"k": k}) #search_type can be "similarity" or "mmr"
116
+
117
+ chain = ConversationalRetrievalChain.from_llm(
118
+ llm=llm,
119
+ chain_type="stuff", #chain type can be refine, stuff, map_reduce
120
+ retriever=retriever,
121
+ memory=memory,
122
+ return_source_documents=True, #When used these 2 properties, the output gets 3 properties: answer, source_document, source_document_score and then have to speocify input and output key in memory for it to work
123
+ combine_docs_chain_kwargs=dict({"prompt": PROMPT})
124
+ )
125
+
126
+ return chain
127
+
128
+ #Class using all above components to create QA system
129
+ class ConversationalResponse:
130
+ def __init__(self, url, branch, file_filter):
131
+ self.url = url
132
+ self.branch = branch
133
+ self.file_filter = file_filter
134
+ self.data = loader(self.url, self.branch, self.file_filter)
135
+ self.chunks = split_data(self.data)
136
+ self.vector_store = ingest_chunks(self.chunks)
137
+ self.chain_type = "stuff"
138
+ self.k = 10
139
+ self.chain = retreival(self.vector_store, self.k)
140
+
141
+ def __call__(self, question):
142
+ agent = self.chain(question)
143
+ return agent['answer']
.history/src/main_20240310203826.py ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import openai
3
+ import sys
4
+ sys.path.append('../..')
5
+ from langchain.embeddings.openai import OpenAIEmbeddings
6
+ from langchain.text_splitter import CharacterTextSplitter, RecursiveCharacterTextSplitter
7
+ from langchain.vectorstores import DocArrayInMemorySearch
8
+ from langchain.document_loaders import TextLoader
9
+ from langchain.chains import RetrievalQA, ConversationalRetrievalChain
10
+ from langchain.memory import ConversationBufferMemory
11
+ from langchain.chat_models import ChatOpenAI
12
+ from langchain.document_loaders import TextLoader
13
+ from langchain.document_loaders import GitLoader
14
+ from langchain.llms import OpenAI
15
+ from langchain.memory import ConversationBufferMemory, ConversationBufferWindowMemory
16
+ from langchain.vectorstores import Chroma
17
+ from langchain.embeddings.openai import OpenAIEmbeddings
18
+ from langchain.prompts import PromptTemplate, SystemMessagePromptTemplate, HumanMessagePromptTemplate, AIMessagePromptTemplate, ChatPromptTemplate
19
+ import datetime
20
+ import shutil
21
+
22
+
23
+ # Function to load the data from github using langchain with string type url, string type branch, string type file_filter
24
+ def loader(url: str, branch: str, file_filter: str):
25
+ repo_path = "./github_repo"
26
+ if os.path.exists(repo_path):
27
+ shutil.rmtree(repo_path)
28
+
29
+ loader = GitLoader(
30
+ clone_url= url,
31
+ repo_path="./github_repo/",
32
+ branch=branch,
33
+ file_filter=lambda file_path: file_path.endswith(tuple(file_filter.split(','))) # Filter out files in Data but whole repo is cloned
34
+ )
35
+
36
+ data = loader.load()
37
+ return data
38
+
39
+
40
+ #Function to split the data into chunks using recursive character text splitter
41
+ def split_data(data):
42
+ splitter = RecursiveCharacterTextSplitter(
43
+ chunk_size=1000,
44
+ chunk_overlap=150,
45
+ length_function=len, # Function to measure the length of chunks while splitting
46
+ add_start_index=True # Include the starting position of each chunk in metadata
47
+ )
48
+ chunks = splitter.split_documents(data)
49
+ return chunks
50
+
51
+ #Function to ingest the chunks into a vectorstore of doc
52
+ def ingest_chunks(chunks):
53
+ embedding = OpenAIEmbeddings(
54
+ # deployment="your-embeddings-deployment-name",
55
+ model="nomic-embed-text",
56
+ openai_api_base="https://thewise-ollama-server.hf.space",
57
+ # openai_api_type="azure",
58
+ openai_api_key='nothing'
59
+ )
60
+ vector_store = DocArrayInMemorySearch.from_documents(chunks, embedding)
61
+
62
+ repo_path = "./github_repo"
63
+ if os.path.exists(repo_path):
64
+ shutil.rmtree(repo_path)
65
+
66
+ return vector_store
67
+
68
+ #Retreival function to get the data from the database and reply to the user
69
+ def retreival(vector_store, k):
70
+ #Creating LLM
71
+ llm = ChatOpenAI(model='codellama', temperature=0, openai_api_base='https://thewise-ollama-server.hf.space', openai_api_key='nothing')
72
+
73
+ # Define the system message template
74
+ #Adding CHAT HISTORY to the System template explicitly because mainly Chat history goes to Condense the Human Question with Backround (Not template), but System template goes straight the LLM Chain
75
+ #Explicitly adding chat history to access previous chats and answer "what is my previous question?"
76
+ #Great thing this also sends the chat history to the LLM Model along with the context and question
77
+ system_template = """You're a code summarisation assistant. Given the following extracted parts of a long document as "CONTEXT" create a final answer.
78
+ If you don't know the answer, just say that you don't know. Don't try to make up an answer.
79
+ Only If asked to create a "DIAGRAM" for code use "MERMAID SYNTAX LANGUAGE" in your answer from "CONTEXT" and "CHAT HISTORY" with a short explanation of diagram.
80
+ CONTEXT: {context}
81
+ =======
82
+ CHAT HISTORY: {chat_history}
83
+ =======
84
+ FINAL ANSWER:"""
85
+
86
+ human_template = """{question}"""
87
+
88
+ # ai_template = """
89
+ # FINAL ANSWER:"""
90
+
91
+ # Create the chat prompt templates
92
+ messages = [
93
+ SystemMessagePromptTemplate.from_template(system_template),
94
+ HumanMessagePromptTemplate.from_template(human_template)
95
+ # AIMessagePromptTemplate.from_template(ai_template)
96
+ ]
97
+
98
+ PROMPT = ChatPromptTemplate.from_messages(messages)
99
+
100
+ #Creating memory
101
+ # memory = ConversationBufferMemory(
102
+ # memory_key="chat_history",
103
+ # input_key="question",
104
+ # output_key="answer",
105
+ # return_messages=True)
106
+
107
+ memory = ConversationBufferWindowMemory(
108
+ memory_key="chat_history",
109
+ input_key="question",
110
+ output_key="answer",
111
+ return_messages=True,
112
+ k=5)
113
+
114
+ #Creating the retriever, this can also be a contextual compressed retriever
115
+ retriever = vector_store.as_retriever(search_type="similarity", search_kwargs={"k": k}) #search_type can be "similarity" or "mmr"
116
+
117
+ chain = ConversationalRetrievalChain.from_llm(
118
+ llm=llm,
119
+ chain_type="stuff", #chain type can be refine, stuff, map_reduce
120
+ retriever=retriever,
121
+ memory=memory,
122
+ return_source_documents=True, #When used these 2 properties, the output gets 3 properties: answer, source_document, source_document_score and then have to speocify input and output key in memory for it to work
123
+ combine_docs_chain_kwargs=dict({"prompt": PROMPT})
124
+ )
125
+
126
+ return chain
127
+
128
+ #Class using all above components to create QA system
129
+ class ConversationalResponse:
130
+ def __init__(self, url, branch, file_filter):
131
+ self.url = url
132
+ self.branch = branch
133
+ self.file_filter = file_filter
134
+ self.data = loader(self.url, self.branch, self.file_filter)
135
+ self.chunks = split_data(self.data)
136
+ self.vector_store = ingest_chunks(self.chunks)
137
+ self.chain_type = "stuff"
138
+ self.k = 10
139
+ self.chain = retreival(self.vector_store, self.k)
140
+
141
+ def __call__(self, question):
142
+ agent = self.chain(question)
143
+ return agent['answer']
Dockerfile CHANGED
@@ -1,19 +1,45 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9
3
 
4
- # Set the working directory in the container
5
- WORKDIR /usr/src/app
6
 
7
- # Copy the current directory contents into the container at /usr/src/app
8
- COPY requirements.txt ./
9
- COPY app.py ./
10
- COPY src ./src
11
 
12
- # Install any needed packages specified in requirements.txt
13
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- # Make port 8501 available to the world outside this container
16
  EXPOSE 8501
17
 
18
- # Run app.py when the container launches
19
- CMD ["streamlit", "run", "app.py"]
 
 
1
+ # # Use an official Python runtime as a parent image
2
+ # FROM python:3.9
3
 
4
+ # # Create a non-root user 'appuser' with home directory /home/appuser
5
+ # RUN useradd -m appuser
6
 
7
+ # # Set a working directory for copying requirements initially as root
8
+ # WORKDIR /app
 
 
9
 
10
+ # # Copy only the requirements file, to cache the pip install step
11
+ # COPY ./ /app
12
+
13
+ # # Install Python dependencies
14
+ # RUN pip3 install --no-cache-dir -r /app/requirements.txt
15
+ # RUN pip install "langchain[docarray]"
16
+ # RUN pip3 install "langchain[docarray]"
17
+
18
+ # # Expose the port the app runs on
19
+ # EXPOSE 8501
20
+
21
+ # # Define the command to run the app
22
+ # CMD streamlit run app.py --server.address=0.0.0.0
23
+
24
+
25
+ FROM python:3.9-slim
26
+
27
+ WORKDIR /app
28
+
29
+ RUN apt-get update && apt-get install -y \
30
+ build-essential \
31
+ curl \
32
+ software-properties-common \
33
+ git \
34
+ && rm -rf /var/lib/apt/lists/*
35
+
36
+ COPY ./ /app
37
+
38
+ RUN pip3 install -r requirements.txt
39
+ RUN pip3 install 'langchain[docarray]'
40
 
 
41
  EXPOSE 8501
42
 
43
+ HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
44
+
45
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
requirements.txt CHANGED
@@ -1,5 +1,5 @@
 
1
  streamlit
2
  langchain==0.0.305
3
  langchain[docarray]
4
- tiktoken
5
- openai
 
1
+ openai
2
  streamlit
3
  langchain==0.0.305
4
  langchain[docarray]
5
+ tiktoken
 
src/main.py CHANGED
@@ -52,7 +52,7 @@ def split_data(data):
52
  def ingest_chunks(chunks):
53
  embedding = OpenAIEmbeddings(
54
  # deployment="your-embeddings-deployment-name",
55
- model="codellama",
56
  openai_api_base="https://thewise-ollama-server.hf.space",
57
  # openai_api_type="azure",
58
  openai_api_key='nothing'
 
52
  def ingest_chunks(chunks):
53
  embedding = OpenAIEmbeddings(
54
  # deployment="your-embeddings-deployment-name",
55
+ model="nomic-embed-text",
56
  openai_api_base="https://thewise-ollama-server.hf.space",
57
  # openai_api_type="azure",
58
  openai_api_key='nothing'