Spaces:
Sleeping
Sleeping
abdullahmubeen10
commited on
Commit
•
75f5664
1
Parent(s):
a7f9f46
Update Dockerfile
Browse files- Dockerfile +70 -72
Dockerfile
CHANGED
@@ -1,72 +1,70 @@
|
|
1 |
-
# Download base image ubuntu 18.04
|
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 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
&&
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
&&
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
ENV
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
# Define the entry point for the container
|
72 |
-
ENTRYPOINT ["streamlit", "run", "streamlit.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
1 |
+
# Download base image ubuntu 18.04
|
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 |
+
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 \
|
15 |
+
tar \
|
16 |
+
wget \
|
17 |
+
bash \
|
18 |
+
rsync \
|
19 |
+
gcc \
|
20 |
+
libfreetype6-dev \
|
21 |
+
libhdf5-serial-dev \
|
22 |
+
libpng-dev \
|
23 |
+
libzmq3-dev \
|
24 |
+
python3 \
|
25 |
+
python3-dev \
|
26 |
+
python3-pip \
|
27 |
+
unzip \
|
28 |
+
pkg-config \
|
29 |
+
software-properties-common \
|
30 |
+
graphviz \
|
31 |
+
openjdk-8-jdk \
|
32 |
+
ant \
|
33 |
+
ca-certificates-java \
|
34 |
+
libgomp1 \
|
35 |
+
&& apt-get clean \
|
36 |
+
&& update-ca-certificates -f
|
37 |
+
|
38 |
+
# Install Python 3.8 and pip
|
39 |
+
RUN add-apt-repository ppa:deadsnakes/ppa \
|
40 |
+
&& apt-get update \
|
41 |
+
&& apt-get install -y python3.8 python3-pip \
|
42 |
+
&& apt-get clean
|
43 |
+
|
44 |
+
# Set up JAVA_HOME
|
45 |
+
RUN echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/" >> /etc/profile \
|
46 |
+
&& echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile
|
47 |
+
|
48 |
+
# Create a new user named "jovyan" with user ID 1000
|
49 |
+
RUN useradd -m -u ${NB_UID} ${NB_USER}
|
50 |
+
|
51 |
+
# Switch to the "jovyan" user
|
52 |
+
USER ${NB_USER}
|
53 |
+
|
54 |
+
# Set home and path variables for the 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"]
|
|
|
|