File size: 1,366 Bytes
9b1d12d
 
b3f566d
9b1d12d
e052b54
29cb98d
9b1d12d
 
 
 
 
 
 
 
cc6a9bb
29cb98d
9b1d12d
 
 
 
 
 
 
 
 
 
29cb98d
0584773
f048051
0584773
 
62d9f9f
29cb98d
e052b54
cc6a9bb
 
29cb98d
cc6a9bb
 
29cb98d
 
 
2ba9f9a
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
# Use an older Ubuntu version that supports Python 3.4
FROM ubuntu:14.04

# Update package lists and install required dependencies
RUN apt-get update && apt-get install -y \
    software-properties-common \
    build-essential \
    libssl-dev \
    zlib1g-dev \
    libncurses5-dev \
    libgdbm-dev \
    libnss3-dev \
    libreadline-dev \
    libffi-dev \
    wget \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Add deadsnakes PPA for Python 3.4
RUN add-apt-repository ppa:deadsnakes/ppa && apt-get update

# Install Python 3.4
RUN apt-get install -y python3.4 python3.4-dev python3.4-venv

# Set Python 3.4 as default (optional)
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.4 1

# Copy requirements file
COPY requirements.txt /tmp/requirements.txt

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

# 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

# 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"]