-
Notifications
You must be signed in to change notification settings - Fork 6
/
heroku.Dockerfile
48 lines (38 loc) · 1.06 KB
/
heroku.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
FROM ubuntu:18.04
MAINTAINER Cuda Chen <[email protected]>
# streamlit-specific commands for config
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /root/.streamlit
RUN bash -c 'echo -e "\
[general]\n\
email = \"\"\n\
" > /root/.streamlit/credentials.toml'
RUN bash -c 'echo -e "\
[server]\n\
enableCORS = false\n\
" > /root/.streamlit/config.toml'
# install Python and Pip
#
# NOTE: libSM.so.6 is required for OpenCV Docker
# or you will get seg fault when import OpenCV
RUN apt-get update && \
apt-get install -y \
python3.7 python3-pip \
libsm6 libxext6 libxrender-dev
# expose port 8501 for streamlit
EXPOSE 8501
# make app directiry
WORKDIR /streamlit-docker
# copy requirements.txt
COPY requirements.txt ./requirements.txt
# install dependencies
RUN pip3 install -r requirements.txt
# copy all files over
COPY . .
# set heroku_startup.sh to be executable
RUN chmod +x ./heroku_startup.sh
# download YOLO weights
RUN gdown --output ./yolo-fish/fish.weights --id 1L6JgzbFhC7Bb_5w_V-stAkPSgMplvsmq
# launch streamlit app
ENTRYPOINT "./heroku_startup.sh"