File size: 862 Bytes
9cbb3b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692f700
9cbb3b0
692f700
9cbb3b0
 
 
 
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
FROM python:3.9-slim

# Install Debian equivalents of Ubuntu packages
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    fonts-liberation \
    libgl1 \
    libglx-mesa0 \
    mesa-utils \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Create user
RUN adduser --disabled-password --gecos '' streamlit-user
RUN chown -R streamlit-user:streamlit-user /app

USER streamlit-user
ENV HOME=/app
ENV PATH="/app/.local/bin:${PATH}"

COPY requirements.txt ./
RUN pip3 install --user -r requirements.txt

RUN mkdir -p .streamlit
COPY .streamlit/ ./.streamlit/
COPY src/ ./src/

ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_ENABLECORS=false
ENV STREAMLIT_SERVER_PORT=7860

EXPOSE 7860

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py"]