FROM mendelxu/pytorch:d2_nvcr_2008 # Set up a new user named "user" with user ID 1000 RUN useradd -m -u 1000 user # Switch to the "user" user USER user # Set home to the user's home directory ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory to the user's home directory WORKDIR $HOME/app RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true RUN --mount=type=secret,id=git_repo,mode=0444,required=true \ git init && \ git remote add origin $(cat /run/secrets/git_repo) RUN git pull origin main RUN pip install gradio ENV GRADIO_SERVER_NAME=0.0.0.0 EXPOSE 7860 RUN echo "gradio app.py">>run.sh CMD ["script","-c","sh run.sh","/dev/null"]