|
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu20.04 |
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \ |
|
TZ=Europe/Paris |
|
|
|
RUN rm -f /etc/apt/sources.list.d/*.list && \ |
|
apt-get update && apt-get install -y --no-install-recommends \ |
|
sudo \ |
|
git \ |
|
curl \ |
|
wget \ |
|
ffmpeg libsm6 libxext6 \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
WORKDIR /app |
|
|
|
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ |
|
&& chown -R user:user /app \ |
|
&& echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user |
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
CONDA_AUTO_UPDATE_CONDA=false |
|
ENV PATH=$HOME/miniconda/bin:$PATH |
|
RUN mkdir $HOME/.cache $HOME/.config \ |
|
&& chmod -R 777 $HOME \ |
|
&& curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py310_24.5.0-0-Linux-x86_64.sh \ |
|
&& chmod +x ~/miniconda.sh \ |
|
&& ~/miniconda.sh -b -p ~/miniconda \ |
|
&& rm ~/miniconda.sh \ |
|
&& conda clean -ya |
|
|
|
|
|
RUN --mount=target=requirements.txt,source=requirements.txt \ |
|
pip install --no-cache-dir torch torchvision && \ |
|
pip install --no-cache-dir git+https://github.com/openai/CLIP.git && \ |
|
pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN git clone https://github.com/sachit-menon/GLIP |
|
|
|
|
|
COPY --link --chown=1000 ./ /app |
|
EXPOSE 7860 |
|
ENV GRADIO_SERVER_NAME="0.0.0.0" |
|
CMD ["bash", "app.sh"] |
|
|