File size: 1,497 Bytes
31efb9f
0fc1a6b
 
 
 
 
328e645
 
d5e8818
06ac684
328e645
37d04e5
a6a2e04
ef25922
 
3c37308
328e645
 
510cc72
328e645
3c37308
 
06ac684
 
 
3c37308
06ac684
510cc72
 
1f519c3
0f98b99
 
06ac684
 
dc0a323
06ac684
1f17321
 
 
328e645
3c8a85e
328e645
bdddc73
 
885666a
328e645
1669dc6
80fcf85
9a057fe
328e645
510cc72
328e645
510cc72
328e645
1d08457
e4fb674
7df508b
 
 
 
 
 
 
 
 
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM nvidia/cuda:12.2.2-cudnn8-devel-ubuntu22.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install --no-install-recommends -y \
  build-essential \
  ffmpeg \
  python3-pip \
  python3-dev \
  python3-venv \
  ninja-build \
  libreoffice \
  git \
  unzip \
  wget \
  curl \
  && apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /data

RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

ENV VIRTUAL_ENV=/opt/venv

RUN python3 -m venv $VIRTUAL_ENV
ENV PATH=$VIRTUAL_ENV/bin:$PATH:/root/.cargo/bin:${PATH}

COPY ./requirements.txt /data/requirements.txt
RUN pip3 install --no-cache-dir --upgrade -r /data/requirements.txt

RUN python3 -m spacy download en_core_web_sm

COPY pip.conf $VIRTUAL_ENV/pip.conf

RUN pip3 install onnxruntime-gpu==1.17.1

RUN useradd -m -u 1000 user
USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH \
    PYTHONPATH=$HOME/app \
    PYTHONUNBUFFERED=1 \
    NVIDIA_VISIBLE_DEVICES=all \
    NVIDIA_DRIVER_CAPABILITIES=compute,utility \
	SYSTEM=spaces \
    HF_HOME=/data \
    NLTK_DATA=$HF_HOME \
    TOKENIZERS_PARALLELISM=false

WORKDIR $HOME/data

COPY --chown=user . $HOME/data

EXPOSE 8501

CMD streamlit run app.py \
    --server.headless true \
    --server.enableCORS false \
    --server.enableXsrfProtection false \
    --server.fileWatcherType watchdog \
    --theme.backgroundColor "#EEE3D3" \
    --theme.secondaryBackgroundColor "#CCC8C2" \
    --theme.primaryColor "#EF792D" \
    --theme.textColor "#7D6654"