File size: 2,865 Bytes
9723a91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d52fdcb
0b45bd9
d52fdcb
b7649f3
9723a91
3920996
9723a91
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63db0b2
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
66
67
68
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/vaitor2.git

RUN mv $HOME/app/vaitor2/* $HOME/app/

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

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

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

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

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

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

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

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

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

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

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


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