File size: 886 Bytes
bdb6e6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION} as base

RUN apt-get update && apt-get install -y \
  git-lfs \
  ffmpeg \
  libsm6 \
  libxext6 \
  cmake \
  libgl1-mesa-glx

RUN git lfs install

#COPY packages.txt /root/packages.txt
#RUN apt-get update && xargs -r -a /root/packages.txt apt-get install -y

RUN useradd -m user
USER user


FROM base as deps

ENV HOME /home/user
ENV PATH $HOME/.local/bin:$PATH
WORKDIR $HOME
RUN mkdir app
WORKDIR $HOME/app

ARG PIP_VERSION=22.1.1
RUN pip install \
  pip==${PIP_VERSION} \
  datasets \
  huggingface-hub

COPY requirements.txt $HOME/app/requirements.txt
RUN pip install -r requirements.txt


from deps as app

COPY --chown=user ./app.py $HOME/app

ENV PYTHONPATH $HOME/app
ENV PYTHONUNBUFFERED 1
ENV GRADIO_ALLOW_FLAGGING never
ENV GRADIO_NUM_PORTS 1
ENV GRADIO_SERVER_NAME 0.0.0.0
ENV GRADIO_THEME huggingface
ENV SYSTEM spaces