|
|
|
FROM ghcr.io/huggingface/text-generation-inference:2.0 as base |
|
|
|
|
|
RUN apt-get update && apt-get install -y git |
|
|
|
COPY ./requirements.txt /code/requirements.txt |
|
|
|
RUN pip install -r /code/requirements.txt |
|
|
|
|
|
RUN useradd -m -u 1000 -s /bin/bash user |
|
|
|
|
|
RUN mkdir /data && chown user:user /data |
|
|
|
|
|
USER user |
|
|
|
|
|
WORKDIR /home/user |
|
|
|
|
|
ENV PATH="/home/user/.local/bin:${PATH}" |
|
|
|
|
|
ENTRYPOINT [] |
|
|
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH \ |
|
PYTHONPATH=$HOME/app \ |
|
PYTHONUNBUFFERED=1 \ |
|
GRADIO_ALLOW_FLAGGING=never \ |
|
GRADIO_NUM_PORTS=1 \ |
|
GRADIO_SERVER_NAME=0.0.0.0 \ |
|
GRADIO_THEME=huggingface \ |
|
SYSTEM=spaces |
|
|
|
|
|
COPY --chown=user . $HOME/ |
|
|
|
|
|
CMD python /home/user/app.py |