News-Dashboard / Dockerfile
Bayhaqy's picture
Update Dockerfile
07225b7
raw
history blame contribute delete
No virus
1.46 kB
# 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"]