CoolFace
Apppublic

rafaelpo/everyrow_active_learning

sourceHugging Faceupdated 8mo agoView on Hugging Face
1likes
Dockerfile111 linesDownload Raw Back to root
1FROM nvidia/cuda:12.5.1-cudnn-devel-ubuntu20.042 3ENV DEBIAN_FRONTEND=noninteractive \4    TZ=Europe/Paris5 6# Remove any third-party apt sources to avoid issues with expiring keys.7# Install some basic utilities8RUN rm -f /etc/apt/sources.list.d/*.list && \9    apt-get update && apt-get install -y --no-install-recommends \10    curl \11    ca-certificates \12    sudo \13    git \14    wget \15    procps \16    git-lfs \17    zip \18    unzip \19    htop \20    vim \21    nano \22    bzip2 \23    libx11-6 \24    build-essential \25    libsndfile-dev \26    software-properties-common \27 && rm -rf /var/lib/apt/lists/*28 29RUN add-apt-repository ppa:flexiondotorg/nvtop && \30    apt-get upgrade -y && \31    apt-get install -y --no-install-recommends nvtop32 33RUN curl -sL https://deb.nodesource.com/setup_21.x  | bash - && \34    apt-get install -y nodejs && \35    npm install -g configurable-http-proxy36 37# Create a working directory38WORKDIR /app39 40# Create a non-root user and switch to it41RUN adduser --disabled-password --gecos '' --shell /bin/bash user \42 && chown -R user:user /app43RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user44USER user45 46# All users can use /home/user as their home directory47ENV HOME=/home/user48RUN mkdir $HOME/.cache $HOME/.config \49 && chmod -R 777 $HOME50 51# Set up the Conda environment52ENV CONDA_AUTO_UPDATE_CONDA=false \53    PATH=$HOME/miniconda/bin:$PATH54RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \55 && chmod +x ~/miniconda.sh \56 && ~/miniconda.sh -b -p ~/miniconda \57 && rm ~/miniconda.sh \58 && conda clean -ya59 60# Upgrade to Python 3.12 (everyrow requires >=3.12)61RUN conda install -y python=3.12 && conda clean -ya62 63WORKDIR $HOME/app64 65#######################################66# Start root user section67#######################################68 69USER root70 71# User Debian packages72## Security warning : Potential user code executed as root (build time)73RUN --mount=target=/root/packages.txt,source=packages.txt \74    apt-get update && \75    xargs -r -a /root/packages.txt apt-get install -y --no-install-recommends \76    && rm -rf /var/lib/apt/lists/*77 78RUN --mount=target=/root/on_startup.sh,source=on_startup.sh,readwrite \79    bash /root/on_startup.sh80 81RUN mkdir /data && chown user:user /data82 83#######################################84# End root user section85#######################################86 87USER user88 89# Python packages90RUN --mount=target=requirements.txt,source=requirements.txt \91    pip install --no-cache-dir --upgrade -r requirements.txt92 93# Copy the current directory contents into the container at $HOME/app setting the owner to the user94COPY --chown=user . $HOME/app95 96RUN chmod +x start_server.sh97 98# Copy notebook to /data so it appears in JupyterLab's file browser99COPY --chown=user active_learning_tutorial.ipynb /data/active_learning_tutorial.ipynb100 101COPY --chown=user login.html /home/user/miniconda/lib/python3.9/site-packages/jupyter_server/templates/login.html102 103ENV PYTHONUNBUFFERED=1 \104    GRADIO_ALLOW_FLAGGING=never \105    GRADIO_NUM_PORTS=1 \106    GRADIO_SERVER_NAME=0.0.0.0 \107    GRADIO_THEME=huggingface \108    SYSTEM=spaces \109    SHELL=/bin/bash110 111CMD ["./start_server.sh"]