File size: 1,455 Bytes
ad50e6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d2436ae
ad50e6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d2436ae
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
65
66
67
# Using the Ubuntu image
FROM ubuntu:latest

# set language, format and stuff
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

# Update package manager (apt-get) 
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt update

# installing python3 with a specific version
RUN apt install python3.10 -y
RUN apt install python3.10-distutils -y

# installing other libraries
RUN apt-get install python3-pip -y && apt-get -y install sudo
RUN apt-get update && apt-get install -y git

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Download from Github
RUN git clone https://github.com/bayhaqy/News-Dashboard.git $HOME/app

RUN pwd

RUN ls -lhat .

RUN ls -lhat $HOME

RUN ls -lhat $HOME/app

WORKDIR $HOME/app

# Add permission
RUN chown user $HOME/app
RUN chmod -R 777 ${HOME}

RUN pwd

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
RUN pip install --no-cache-dir --upgrade pip

RUN pwd

RUN ls -lhat
RUN ls -lhat $HOME/app

# Check version
RUN python3 --version

# Make port 8501 available to the world outside this container
EXPOSE 8501

# Define the command to run your Streamlit app
CMD ["streamlit", "run", "Home.py"]