victor7246 commited on
Commit
67fb195
·
verified ·
1 Parent(s): 5c50c27

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -18
Dockerfile CHANGED
@@ -1,10 +1,13 @@
1
- FROM python:3.8.9
2
 
3
  WORKDIR /app
4
 
5
  COPY ./requirements.txt /app/requirements.txt
6
  COPY ./packages.txt /app/packages.txt
7
 
 
 
 
8
  RUN apt-get update \
9
  && apt-get install unixodbc -y \
10
  && apt-get install unixodbc-dev -y \
@@ -19,29 +22,22 @@ Description = FreeTDS Driver\n\
19
  Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so\n\
20
  Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so" >> /etc/odbcinst.ini
21
 
22
- RUN apt-get update && apt-get install -y fakeroot && mv /usr/bin/apt-get /usr/bin/.apt-get && echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && chmod +x /usr/bin/apt-get && rm -rf /var/lib/apt/lists/* && useradd -m -u 1000 user
23
-
24
- RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
25
  RUN pip3 install --no-cache-dir -r /app/requirements.txt
26
 
27
- WORKDIR /home/user/app
28
-
29
- COPY --chown=1000:1000 --from=root / /
 
 
30
 
31
- 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
32
-
33
- RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
34
-
35
- RUN pip install --no-cache-dir streamlit==1.36.0 "uvicorn>=0.14.0" spaces
36
-
37
- RUN mkdir -p .streamlit && git config --global core.excludesfile ~/.gitignore && echo ".streamlit" > ~/.gitignore
38
-
39
- COPY --link --chown=1000 ./ /home/user/app
40
 
41
  EXPOSE 8501
42
  CMD streamlit run app.py \
43
  --server.headless true \
44
  --server.enableCORS false \
45
  --server.enableXsrfProtection false \
46
- --server.fileWatcherType none
47
-
 
1
+ FROM python:3.8-slim-buster
2
 
3
  WORKDIR /app
4
 
5
  COPY ./requirements.txt /app/requirements.txt
6
  COPY ./packages.txt /app/packages.txt
7
 
8
+ RUN apt-get update && xargs -r -a /app/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
9
+
10
+ # install FreeTDS and dependencies
11
  RUN apt-get update \
12
  && apt-get install unixodbc -y \
13
  && apt-get install unixodbc-dev -y \
 
22
  Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so\n\
23
  Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so" >> /etc/odbcinst.ini
24
 
 
 
 
25
  RUN pip3 install --no-cache-dir -r /app/requirements.txt
26
 
27
+ # User
28
+ RUN useradd -m -u 1000 user
29
+ USER user
30
+ ENV HOME /home/user
31
+ ENV PATH $HOME/.local/bin:$PATH
32
 
33
+ WORKDIR $HOME
34
+ RUN mkdir app
35
+ WORKDIR $HOME/app
36
+ COPY . $HOME/app
 
 
 
 
 
37
 
38
  EXPOSE 8501
39
  CMD streamlit run app.py \
40
  --server.headless true \
41
  --server.enableCORS false \
42
  --server.enableXsrfProtection false \
43
+ --server.fileWatcherType none