llava-calm2-preview / Dockerfile
tuxedocat's picture
Use dedicated auth lib
e5d8beb
raw
history blame contribute delete
657 Bytes
FROM python:3.11-slim AS gradio
RUN useradd -m -u 1000 app
USER app
ENV HOME=/home/app \
PATH=/home/app/.local/bin:$PATH
WORKDIR ${HOME}
COPY . .
# https://huggingface.co/docs/hub/spaces-sdks-docker#buildtime
RUN --mount=type=secret,id=EXTRA_INDEX_URL,mode=0444,required=true \
pip install --no-cache-dir --extra-index-url=$(cat /run/secrets/EXTRA_INDEX_URL) cycloud-sdk-python-auth > /dev/null 2>&1
RUN pip install --no-cache-dir -r requirements.txt
RUN --mount=type=secret,id=LLM_CREDENTIALS,mode=0444,required=true \
cat /run/secrets/LLM_CREDENTIALS > ${HOME}/credentials.json
EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"
CMD ["python", "app.py"]