-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
50 lines (47 loc) · 1.51 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:18.04
ENV USER_NAME=ubuntu \
USER_HOME=/home/ubuntu \
# Set clock and location
LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
# Special Streamlit variables
STREAMLIT_GLOBAL_DEVELOPMENT_MODE=False \
STREAMLIT_GLOBAL_LOG_LEVEL=warning \
STREAMLIT_GLOBAL_METRICS=True \
STREAMLIT_BROWSER_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_SERVER_PORT=8501 \
INLOCO_CITIES_ROUTE="" \
INLOCO_STATES_ROUTE="" \
AMPLITUDE_KEY=""
WORKDIR ${USER_HOME}
ADD ./requirements.txt ${USER_HOME}/
RUN set -x \
# Install OS libs
&& apt-get update \
&& apt-get install -y virtualenv python3 curl \
&& apt-get install -y wget\
# Add user
&& useradd -M -u 1000 -s /bin/sh -d ${USER_HOME} ${USER_NAME} \
&& mkdir -p ${USER_HOME} \
&& chown -R 1000:1000 ${USER_HOME}
USER ${USER_NAME}
RUN set -x \
# Create virtualenv
&& virtualenv -p python3 venv \
#Downloads the hacked streamlit
&& wget https://github.com/ImpulsoGov/streamlitlastversion/raw/main/builds/streamlit-0.70.0-py2.py3-none-any.whl \
# Install Python libs
&& . venv/bin/activate \
&& pip install --default-timeout=100 future \
&& pip install --upgrade -r requirements.txt \
# Install streamlit
&& pip install --no-cache-dir streamlit-0.70.0-py2.py3-none-any.whl\
&& python -m ipykernel install --user --name=venv
ADD . ${USER_HOME}
USER root
RUN set -x \
# Set permissions
&& chmod +x setup.sh entrypoint.sh
USER ${USER_NAME}
EXPOSE ${STREAMLIT_SERVER_PORT}
CMD ["./entrypoint.sh"]