Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -6
Dockerfile
CHANGED
@@ -6,9 +6,6 @@ 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 |
-
ENV PYSPARK_PYTHON=/usr/bin/python3.8
|
10 |
-
ENV PYSPARK_DRIVER_PYTHON=/usr/bin/python3.8
|
11 |
-
ENV LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
|
12 |
|
13 |
# Install required packages
|
14 |
RUN apt-get update && apt-get install -y \
|
@@ -31,7 +28,6 @@ RUN apt-get update && apt-get install -y \
|
|
31 |
openjdk-8-jdk \
|
32 |
ant \
|
33 |
ca-certificates-java \
|
34 |
-
libgomp1 \
|
35 |
&& apt-get clean \
|
36 |
&& update-ca-certificates -f
|
37 |
|
@@ -55,17 +51,26 @@ USER ${NB_USER}
|
|
55 |
ENV HOME=/home/${NB_USER} \
|
56 |
PATH=/home/${NB_USER}/.local/bin:$PATH
|
57 |
|
|
|
|
|
|
|
|
|
58 |
# Set the working directory to the user's home directory
|
59 |
WORKDIR ${HOME}
|
60 |
|
61 |
# Upgrade pip and install Python dependencies
|
62 |
RUN python3.8 -m pip install --upgrade pip
|
|
|
|
|
63 |
COPY requirements.txt /tmp/requirements.txt
|
64 |
RUN python3.8 -m pip install -r /tmp/requirements.txt
|
65 |
|
|
|
|
|
|
|
|
|
66 |
# Expose port for Streamlit
|
67 |
EXPOSE 7860
|
68 |
|
69 |
# Define the entry point for the container
|
70 |
-
ENTRYPOINT ["streamlit", "run", "streamlit.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
71 |
-
|
|
|
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 packages
|
11 |
RUN apt-get update && apt-get install -y \
|
|
|
28 |
openjdk-8-jdk \
|
29 |
ant \
|
30 |
ca-certificates-java \
|
|
|
31 |
&& apt-get clean \
|
32 |
&& update-ca-certificates -f
|
33 |
|
|
|
51 |
ENV HOME=/home/${NB_USER} \
|
52 |
PATH=/home/${NB_USER}/.local/bin:$PATH
|
53 |
|
54 |
+
# Set up PySpark to use Python 3.8 for both driver and workers
|
55 |
+
ENV PYSPARK_PYTHON=/usr/bin/python3.8
|
56 |
+
ENV PYSPARK_DRIVER_PYTHON=/usr/bin/python3.8
|
57 |
+
|
58 |
# Set the working directory to the user's home directory
|
59 |
WORKDIR ${HOME}
|
60 |
|
61 |
# Upgrade pip and install Python dependencies
|
62 |
RUN python3.8 -m pip install --upgrade pip
|
63 |
+
|
64 |
+
# Copy requirements.txt to the container and install dependencies
|
65 |
COPY requirements.txt /tmp/requirements.txt
|
66 |
RUN python3.8 -m pip install -r /tmp/requirements.txt
|
67 |
|
68 |
+
# Copy the application code into the container
|
69 |
+
COPY streamlit.py ${HOME}/streamlit.py # Explicitly copy the streamlit.py file
|
70 |
+
COPY . ${HOME} # Copy the rest of the application
|
71 |
+
|
72 |
# Expose port for Streamlit
|
73 |
EXPOSE 7860
|
74 |
|
75 |
# Define the entry point for the container
|
76 |
+
ENTRYPOINT ["streamlit", "run", "/home/jovyan/streamlit.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|