abdullahmubeen10 commited on
Commit
e052b54
·
verified ·
1 Parent(s): 29cb98d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -21
Dockerfile CHANGED
@@ -1,14 +1,14 @@
1
- # Use the latest Ubuntu LTS base image
2
- FROM ubuntu:22.04
3
 
4
  # Set environment variables
5
  ENV NB_USER=jovyan
6
  ENV NB_UID=1000
7
  ENV HOME=/home/${NB_USER}
8
- ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/
9
 
10
- # Upgrade the system and install required packages
11
- RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \
12
  software-properties-common \
13
  wget \
14
  curl \
@@ -23,24 +23,23 @@ RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \
23
  unzip \
24
  pkg-config \
25
  graphviz \
26
- openjdk-17-jdk \
27
- python3.11 \
28
- python3.11-dev \
29
- python3.11-venv \
30
  python3-pip \
31
  ant \
32
  ca-certificates \
33
  && apt-get clean \
34
  && update-ca-certificates -f
35
 
36
- # Set up JAVA_HOME for OpenJDK 17 (latest stable release)
37
- RUN echo "export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/" >> /etc/profile \
38
  && echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile
39
 
40
- # Upgrade Python tools (pip, setuptools, wheel)
41
- RUN python3.11 -m pip install --upgrade pip setuptools wheel
42
 
43
- # Create a new user with a specific UID
44
  RUN useradd -m -u ${NB_UID} ${NB_USER}
45
 
46
  # Switch to the new user
@@ -50,13 +49,9 @@ USER ${NB_USER}
50
  ENV HOME=/home/${NB_USER}
51
  ENV PATH=/home/${NB_USER}/.local/bin:$PATH
52
 
53
- # Set up PySpark to use Python 3.11 for both driver and workers
54
- ENV PYSPARK_PYTHON=/usr/bin/python3.11
55
- ENV PYSPARK_DRIVER_PYTHON=/usr/bin/python3.11
56
-
57
- # Install the latest Python dependencies from requirements.txt
58
  COPY requirements.txt /tmp/requirements.txt
59
- RUN python3.11 -m pip install --upgrade -r /tmp/requirements.txt
60
 
61
  # Copy application code to the container
62
  COPY --chown=${NB_USER}:${NB_USER} . ${HOME}
@@ -65,4 +60,4 @@ COPY --chown=${NB_USER}:${NB_USER} . ${HOME}
65
  EXPOSE 7860
66
 
67
  # Define the entry point for the container
68
- ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
 
1
+ # Use an Ubuntu base image
2
+ FROM ubuntu:18.04
3
 
4
  # Set environment variables
5
  ENV NB_USER=jovyan
6
  ENV NB_UID=1000
7
  ENV HOME=/home/${NB_USER}
8
+ ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
9
 
10
+ # Install required system packages and Python 3.4
11
+ RUN apt-get update && apt-get install -y \
12
  software-properties-common \
13
  wget \
14
  curl \
 
23
  unzip \
24
  pkg-config \
25
  graphviz \
26
+ openjdk-8-jdk \
27
+ python3.4 \
28
+ python3.4-dev \
 
29
  python3-pip \
30
  ant \
31
  ca-certificates \
32
  && apt-get clean \
33
  && update-ca-certificates -f
34
 
35
+ # Set up JAVA_HOME for OpenJDK 8
36
+ RUN echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/" >> /etc/profile \
37
  && echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile
38
 
39
+ # Upgrade pip for Python 3.4 (using an older version of pip)
40
+ RUN python3.4 -m pip install --upgrade pip==9.0.3 setuptools==44.1.1
41
 
42
+ # Create a new user
43
  RUN useradd -m -u ${NB_UID} ${NB_USER}
44
 
45
  # Switch to the new user
 
49
  ENV HOME=/home/${NB_USER}
50
  ENV PATH=/home/${NB_USER}/.local/bin:$PATH
51
 
52
+ # Install Python dependencies from requirements.txt
 
 
 
 
53
  COPY requirements.txt /tmp/requirements.txt
54
+ RUN python3.4 -m pip install --no-cache-dir -r /tmp/requirements.txt
55
 
56
  # Copy application code to the container
57
  COPY --chown=${NB_USER}:${NB_USER} . ${HOME}
 
60
  EXPOSE 7860
61
 
62
  # Define the entry point for the container
63
+ ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]