File size: 1,131 Bytes
c74de41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.9

ARG GIT_PAT

WORKDIR /code

RUN apt-get update && \
    apt-get install -y --no-install-recommends git curl gpg build-essential ffmpeg && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
    apt-get update && \
    apt-get install -y git-lfs && \
    rm -rf /var/lib/apt/lists/* && \
    git lfs install

RUN --mount=type=secret,id=GIT_PAT,mode=0444,required=true \
    HF_PAT=$(cat /run/secrets/GIT_PAT) && \
    git config --global url."https://feddybear:${HF_PAT}@huggingface.co/spaces/".insteadOf "git://huggingface.co/spaces/" && \
    git config --global credential.helper 'store --file ~/.git-credentials' && \
    echo "https://feddybear:${HF_PAT}@huggingface.co/spaces/" > ~/.git-credentials

COPY . .

RUN chmod +x config.sh && ./config.sh && tar -zxf config.tgz && rm -f config.tgz ~/.git-credentials

RUN pip install -U pip && \
    pip install --no-cache-dir --upgrade -r /code/requirements.txt

CMD ["streamlit", "run", "flipscribe.py", "--server.address", "0.0.0.0", "--server.port", "7860"]