yagpt / Dockerfile
kopilk's picture
Update Dockerfile
a138399 verified
raw
history blame
1 kB
FROM ollama/ollama:latest
RUN apt-get install -y git build-essential \
python3 python3-pip gcc wget
# https://huggingface.co/docs/hub/spaces-sdks-docker-first-demo
RUN useradd -m -u 1000 user
# Install depencencies
RUN python3 -m pip install --upgrade pip pytest \
scikit-build setuptools fastapi ollama sse-starlette \
pydantic-settings starlette-context gradio torch huggingface_hub hf_transfer
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONPATH=$HOME/app \
PYTHONUNBUFFERED=1 \
OLLAMA_HOST=0.0.0.0 \
GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_THEME=huggingface \
SYSTEM=spaces
WORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
RUN ollama serve \
& sleep 5 \
&& ollama pull yandex/YandexGPT-5-Lite-8B-instruct-GGUF
CMD ["python3", "app.py"]