FROM python:3.10.14-bookworm ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get upgrade -y && \ apt-get install -y --no-install-recommends \ ca-certificates \ git \ git-lfs \ wget \ jq \ curl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:${PATH} WORKDIR ${HOME}/app RUN python -m venv venv ENV PATH venv/bin:${PATH} RUN venv/bin/pip install "huggingface-hub" "hf-transfer" "gradio[oauth]" "gradio_huggingfacehub_search==0.0.7" "APScheduler" COPY --chown=user . ${HOME}/app RUN git clone https://github.com/ggerganov/llama.cpp RUN venv/bin/pip install -r llama.cpp/requirements.txt ENV PYTHONPATH=${HOME}/app/venv \ PYTHONUNBUFFERED=1 \ HF_HUB_ENABLE_HF_TRANSFER=1 \ GRADIO_ALLOW_FLAGGING=never \ GRADIO_NUM_PORTS=1 \ GRADIO_SERVER_NAME=0.0.0.0 \ GRADIO_THEME=huggingface \ TQDM_POSITION=-1 \ TQDM_MININTERVAL=1 \ SYSTEM=spaces ENTRYPOINT /bin/sh start.sh