Spaces:
Sleeping
Sleeping
FROM python:3.12 | |
WORKDIR /code | |
COPY ./requirements.txt /code/requirements.txt | |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
COPY . /code/app | |
RUN --mount=type=secret, id=HF_TOKEN, required=true && \ | |
cat /run/secrets/HF_TOKEN > /tmp/HF_TOKEN && \ | |
huggingface-cli login --token "$(cat /run/secrets/HF_TOKEN)" --add-to-git-credential | |
RUN useradd -m -u 1000 user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
USER user | |
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 |