Spaces:
Running
Running
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://Benson0418:$(cat /run/secrets/HF_UAT)@huggingface.co/spaces/JunyiAcademy/ai_diag.git | |
RUN mv $HOME/app/ai_diag/* $HOME/app/ && rm -rf $HOME/app/ai_diag | |
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"] | |