File size: 1,228 Bytes
34983e6
86ebf7a
5f54224
 
9f2dd36
 
 
86ebf7a
67fb195
4b2f243
 
 
 
 
 
 
 
c81a2ff
 
9f2dd36
c81a2ff
 
 
4b2f243
 
 
 
 
 
9f2dd36
 
 
6480923
6716adf
 
 
 
 
86ebf7a
9f2dd36
68207c5
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
FROM python:3.10

RUN useradd -m -u 1000 user

WORKDIR /app

COPY --chown=user ./requirements.txt requirements.txt

# install FreeTDS and dependencies
RUN apt-get update \
 && apt-get install unixodbc -y \
 && apt-get install unixodbc-dev -y \
 && apt-get install freetds-dev -y \
 && apt-get install freetds-bin -y \
 && apt-get install tdsodbc -y \
 && apt-get install --reinstall build-essential -y

RUN apt-get update && apt-get install -y 	git 	git-lfs 	ffmpeg 	libsm6 	libxext6 	cmake 	rsync 	libgl1-mesa-glx 	&& rm -rf /var/lib/apt/lists/* 	&& git lfs install

RUN pip install --no-cache-dir 	"uvicorn>=0.14.0" 	spaces

RUN mkdir -p .streamlit && git config --global core.excludesfile ~/.gitignore && echo ".streamlit" > ~/.gitignore

# populate "ocbcinst.ini" as this is where ODBC driver config sits
RUN echo "[FreeTDS]\n\
Description = FreeTDS Driver\n\
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so\n\
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so" >> /etc/odbcinst.ini

RUN pip install --no-cache-dir --upgrade -r requirements.txt

COPY --chown=user . /app

# User
USER user
ENV HOME /home/user
ENV PATH $HOME/.local/bin:$PATH

EXPOSE 8501

ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501"]