-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
39 lines (29 loc) · 805 Bytes
/
dockerfile
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
FROM ubuntu:20.04
SHELL ["/bin/bash", "-c"]
RUN apt update && \
apt install python3.8 \
python3.8-venv \
systemctl \
curl \
nano \
zip \
unzip \
tzdata \
sudo -y
RUN useradd -ms /bin/bash streamlit -G sudo && \
passwd -d streamlit && \
mkdir -p /home/streamlit/python/streamlit/
WORKDIR /home/streamlit/python/streamlit
COPY app/ .
ADD deploy/streamlit.service /etc/systemd/system/
RUN su - streamlit && \
cd /home/streamlit/python/streamlit/ && \
python3 -m venv .venv && \
source .venv/bin/activate && \
pip install -U pip setuptools wheel && \
pip install -r requirements.txt && \
chown -R streamlit:streamlit /home/streamlit
RUN systemctl daemon-reload && \
systemctl enable streamlit.service
USER streamlit
ENTRYPOINT systemctl start streamlit.service