File size: 686 Bytes
37e145d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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"]