derek-thomas's picture
derek-thomas HF staff
Updating jupyter command
a3e5109
raw
history blame
1.29 kB
# Start from the TGI base image
FROM ghcr.io/huggingface/text-generation-inference:1.3 as base
# Create a non-root user with UID 1000
RUN useradd -m -u 1000 -s /bin/bash jupyteruser
# Switch to the non-root user
USER jupyteruser
# Set working directory
WORKDIR /home/jupyteruser
# Install JupyterLab and plugins
RUN pip install --user jupyterlab jupyterlab-vim==0.15.1 jupyterlab-vimrc
# Add local python bin directory to PATH
ENV PATH="/home/jupyteruser/.local/bin:${PATH}"
# Copy any necessary files (if needed)
# COPY --chown=jupyteruser:jupyteruser your-files /home/jupyteruser/your-destination
# AWS Sagemaker compatible image
# Assuming this part remains the same from your original Dockerfile
FROM base as sagemaker
COPY sagemaker-entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
# Final image
FROM base
# Switch to the non-root user
USER jupyteruser
# Set working directory
WORKDIR /home/jupyteruser
# Add local python bin directory to PATH
ENV PATH="/home/jupyteruser/.local/bin:${PATH}"
# Add JupyterLab entrypoint
ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--NotebookApp.token=''", "--port", "7860", "--no-browser"]
# Optional: Set CMD to launch TGI or any other command
#CMD ["text-generation-launcher", "--json-output"]