File size: 816 Bytes
12bf530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5e7662
12bf530
b5e7662
12bf530
 
 
 
 
 
 
 
 
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
FROM python:3.9

USER root
RUN apt-get update && apt-get install -y \
    git \
    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 --mount=type=secret,id=HF_UAT,mode=0444,required=true \
    git clone https://ChenyuRabbitLove:$(cat /run/secrets/HF_UAT)@huggingface.co/spaces/junyiacademy/jutor_write.git

RUN mv $HOME/app/jutor_write/* $HOME/app/

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

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


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