Spaces:
Sleeping
Sleeping
File size: 1,425 Bytes
00d7f53 db451dd 00d7f53 bfe58c8 9999e5f bfe58c8 9999e5f bfe58c8 9999e5f 6d3aa6a 9999e5f 6d3aa6a 9999e5f 5197e76 9999e5f 6d3aa6a 9999e5f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# Start from the TGI base image
FROM ghcr.io/huggingface/text-generation-inference:2.0 as base
# Install git
RUN apt-get update && apt-get install -y git
# Set up the Conda environment
ENV CONDA_AUTO_UPDATE_CONDA=false \
PATH=$HOME/miniconda/bin:$PATH
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
&& chmod +x ~/miniconda.sh \
&& ~/miniconda.sh -b -p ~/miniconda \
&& rm ~/miniconda.sh \
&& conda clean -ya
WORKDIR $HOME/app
# Create a non-root user with UID 1000
RUN useradd -m -u 1000 -s /bin/bash user
# Create the /data directory and set its ownership
RUN mkdir /data && chown user:user /data
#######################################
# End root user section
#######################################
USER user
# Python packages
RUN --mount=target=requirements.txt,source=requirements.txt \
pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user ./jupyterlab $HOME/app
RUN chmod +x start_server.sh
COPY --chown=user ./jupyterlab/login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html
ENV PYTHONUNBUFFERED=1 \
GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
GRADIO_THEME=huggingface \
SYSTEM=spaces \
SHELL=/bin/bash
CMD ["./start_server.sh"] |