-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.st
48 lines (32 loc) · 1.36 KB
/
Dockerfile.st
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 python:3.7-buster as builder
WORKDIR /streamlit-docker
RUN apt-get update \
&& apt-get install -y mecab mecab-utils libmecab-dev \
&& pip install -U pip
RUN git clone --depth 1 https://github.com/neologd/mecab-ipadic-neologd.git /mecab-ipadic-neologd \
&& /mecab-ipadic-neologd/bin/install-mecab-ipadic-neologd -u -n -y -p /var/lib/mecab/dic/mecab-ipadic-neologd \
&& update-alternatives --install /var/lib/mecab/dic/debian mecab-dictionary /var/lib/mecab/dic/mecab-ipadic-neologd 100 \
&& rm -rf /mecab-ipadic-neologd
COPY requirements.txt /streamlit-docker
RUN pip install -r requirements.txt
FROM python:3.7-slim-buster as runner
COPY --from=builder /usr/local/lib/python3.7/site-packages /usr/local/lib/python3.7/site-packages
COPY --from=builder /usr/local/bin/streamlit /usr/local/bin/streamlit
COPY --from=builder /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
ENV PATH $PATH:/usr/local/bin/streamlit
WORKDIR /streamlit-docker
USER root
EXPOSE 8501
COPY .streamlit /streamlit-docker/.streamlit
CMD streamlit run app.py
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'