vaitor_public_2 / Dockerfile
youngtsai's picture
Update Dockerfile
17ac113 verified
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"]