File size: 869 Bytes
8c498fb
 
 
 
 
dba15d8
8c498fb
 
 
 
 
 
 
 
 
 
 
 
 
 
7b62c5e
 
8c498fb
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.9

USER root
RUN apt-get update && apt-get install -y \
    git \
    git-lfs \
    ca-certificates \
    --no-install-recommends && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user

USER user

ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

RUN git lfs install

RUN --mount=type=secret,id=HF_UAT,mode=0444,required=true \
    git clone https://ChenyuRabbitLove:$(cat /run/secrets/HF_UAT)@huggingface.co/spaces/JunyiAcademy/J_diagnosis_3.git

RUN mv $HOME/app/J_diagnosis_3/* $HOME/app/ && rm -rf $HOME/app/J_diagnosis_3

RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt

RUN --mount=type=secret,id=DEPLOY,mode=0444,required=true \
    export DEPLOY=$(cat /run/secrets/DEPLOY) && \
    echo "export local_config=${DEPLOY}" >> $HOME/.bashrc

CMD ["python", "app.py"]