File size: 644 Bytes
77f3eaf
748e8a4
 
974ec25
2f7a0cd
5ef899c
36a9660
 
790299e
795b9ed
2f7a0cd
1c20b6e
 
6630247
89d4f0b
cd33363
 
790299e
f51ea2c
 
 
cd33363
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.12

RUN useradd -m -u 1000 user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
COPY . $HOME/app
RUN apt-get update && \
    apt-get install -y git && \
    pip install --no-cache-dir huggingface_hub[cli] && \
    huggingface-cli login --token $'(cat /run/secrets/HF_TOKEN)' --add-to-git-credential

USER user
WORKDIR $HOME/app
RUN pip install --user --no-cache-dir --upgrade -r requirements.txt
EXPOSE 7860

# Login to Hugging Face at runtime & Start app
CMD streamlit run app.py \
    --server.headless true \
    --server.enableCORS false \
    --server.enableXsrfProtection false \
    --server.fileWatcherType none