Spaces:
Running
Running
abdullahmubeen10
commited on
Update Dockerfile
Browse files- Dockerfile +9 -8
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Download base image
|
2 |
FROM ubuntu:22.04
|
3 |
|
4 |
# Set environment variables
|
@@ -8,14 +8,14 @@ ENV HOME /home/${NB_USER}
|
|
8 |
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64/
|
9 |
|
10 |
# Install required packages
|
11 |
-
RUN apt-get update && apt-get install -y \
|
12 |
tar \
|
13 |
wget \
|
14 |
bash \
|
15 |
rsync \
|
16 |
gcc \
|
17 |
libfreetype6-dev \
|
18 |
-
libhdf5-
|
19 |
libpng-dev \
|
20 |
libzmq3-dev \
|
21 |
python3 \
|
@@ -31,15 +31,16 @@ RUN apt-get update && apt-get install -y \
|
|
31 |
&& apt-get clean \
|
32 |
&& update-ca-certificates -f
|
33 |
|
34 |
-
# Install Python 3.
|
35 |
RUN add-apt-repository ppa:deadsnakes/ppa \
|
36 |
-
&& apt-get update \
|
37 |
-
&& apt-get install -y python3.11 python3-pip \
|
38 |
&& apt-get clean
|
39 |
|
40 |
# Set up JAVA_HOME
|
41 |
RUN echo "export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/" >> /etc/profile \
|
42 |
&& echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile
|
|
|
43 |
# Create a new user named "jovyan" with user ID 1000
|
44 |
RUN useradd -m -u ${NB_UID} ${NB_USER}
|
45 |
|
@@ -50,7 +51,7 @@ USER ${NB_USER}
|
|
50 |
ENV HOME=/home/${NB_USER} \
|
51 |
PATH=/home/${NB_USER}/.local/bin:$PATH
|
52 |
|
53 |
-
# Set up PySpark to use Python 3.
|
54 |
ENV PYSPARK_PYTHON=/usr/bin/python3.11
|
55 |
ENV PYSPARK_DRIVER_PYTHON=/usr/bin/python3.11
|
56 |
|
@@ -69,4 +70,4 @@ COPY --chown=${NB_USER}:${NB_USER} . ${HOME}
|
|
69 |
EXPOSE 7860
|
70 |
|
71 |
# Define the entry point for the container
|
72 |
-
ENTRYPOINT ["streamlit", "run", "
|
|
|
1 |
+
# Download base image: latest Ubuntu LTS
|
2 |
FROM ubuntu:22.04
|
3 |
|
4 |
# Set environment variables
|
|
|
8 |
ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64/
|
9 |
|
10 |
# Install required packages
|
11 |
+
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
|
12 |
tar \
|
13 |
wget \
|
14 |
bash \
|
15 |
rsync \
|
16 |
gcc \
|
17 |
libfreetype6-dev \
|
18 |
+
libhdf5-dev \
|
19 |
libpng-dev \
|
20 |
libzmq3-dev \
|
21 |
python3 \
|
|
|
31 |
&& apt-get clean \
|
32 |
&& update-ca-certificates -f
|
33 |
|
34 |
+
# Install Python 3.11 (latest stable version)
|
35 |
RUN add-apt-repository ppa:deadsnakes/ppa \
|
36 |
+
&& DEBIAN_FRONTEND=noninteractive apt-get update \
|
37 |
+
&& apt-get install -y python3.11 python3.11-venv python3.11-dev python3-pip \
|
38 |
&& apt-get clean
|
39 |
|
40 |
# Set up JAVA_HOME
|
41 |
RUN echo "export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/" >> /etc/profile \
|
42 |
&& echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile
|
43 |
+
|
44 |
# Create a new user named "jovyan" with user ID 1000
|
45 |
RUN useradd -m -u ${NB_UID} ${NB_USER}
|
46 |
|
|
|
51 |
ENV HOME=/home/${NB_USER} \
|
52 |
PATH=/home/${NB_USER}/.local/bin:$PATH
|
53 |
|
54 |
+
# Set up PySpark to use Python 3.11 for both driver and workers
|
55 |
ENV PYSPARK_PYTHON=/usr/bin/python3.11
|
56 |
ENV PYSPARK_DRIVER_PYTHON=/usr/bin/python3.11
|
57 |
|
|
|
70 |
EXPOSE 7860
|
71 |
|
72 |
# Define the entry point for the container
|
73 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|