File size: 1,613 Bytes
e052b54
 
b3f566d
cc6a9bb
29cb98d
 
 
e052b54
b3f566d
e052b54
 
29cb98d
cc6a9bb
29cb98d
 
cc6a9bb
 
 
 
29cb98d
cc6a9bb
29cb98d
cc6a9bb
 
 
e052b54
 
 
29cb98d
cc6a9bb
29cb98d
cc6a9bb
 
b3f566d
e052b54
 
cc6a9bb
29cb98d
e052b54
 
29cb98d
e052b54
cc6a9bb
 
29cb98d
cc6a9bb
 
29cb98d
 
 
2ba9f9a
e052b54
cc6a9bb
e052b54
cc6a9bb
29cb98d
7a77c92
b3f566d
2ba9f9a
 
 
 
e052b54
1
2
3
4
5
6
7
8
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
56
57
58
59
60
61
62
63
64
# Use an Ubuntu base image
FROM ubuntu:18.04

# Set environment variables
ENV NB_USER=jovyan
ENV NB_UID=1000
ENV HOME=/home/${NB_USER}
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/

# Install required system packages and Python 3.4
RUN apt-get update && apt-get install -y \
    software-properties-common \
    wget \
    curl \
    tar \
    bash \
    rsync \
    gcc \
    libfreetype6-dev \
    libhdf5-dev \
    libpng-dev \
    libzmq5-dev \
    unzip \
    pkg-config \
    graphviz \
    openjdk-8-jdk \
    python3.4 \
    python3.4-dev \
    python3-pip \
    ant \
    ca-certificates \
    && apt-get clean \
    && update-ca-certificates -f

# Set up JAVA_HOME for OpenJDK 8
RUN echo "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/" >> /etc/profile \
    && echo "export PATH=\$JAVA_HOME/bin:\$PATH" >> /etc/profile

# Upgrade pip for Python 3.4 (using an older version of pip)
RUN python3.4 -m pip install --upgrade pip==9.0.3 setuptools==44.1.1

# Create a new user
RUN useradd -m -u ${NB_UID} ${NB_USER}

# Switch to the new user
USER ${NB_USER}

# Set user-specific environment variables
ENV HOME=/home/${NB_USER}
ENV PATH=/home/${NB_USER}/.local/bin:$PATH

# Install Python dependencies from requirements.txt
COPY requirements.txt /tmp/requirements.txt
RUN python3.4 -m pip install --no-cache-dir -r /tmp/requirements.txt

# Copy application code to the container
COPY --chown=${NB_USER}:${NB_USER} . ${HOME}

# Expose port for Streamlit
EXPOSE 7860

# Define the entry point for the container
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]