forked from multimodal-art-projection/YuE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
108 lines (83 loc) · 2.52 KB
/
Dockerfile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
ARG CUDA_VERSION="12.4.1"
ARG CUDNN_VERSION=""
ARG UBUNTU_VERSION="22.04"
ARG DOCKER_FROM=nvidia/cuda:$CUDA_VERSION-cudnn$CUDNN_VERSION-devel-ubuntu$UBUNTU_VERSION
ARG GRADIO_PORT=7860
FROM $DOCKER_FROM AS base
WORKDIR /
# Environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV PYTHON_VERSION=3.12
ENV CONDA_DIR=/opt/conda
ENV PATH="$CONDA_DIR/bin:$PATH"
# ENV NUM_GPUS=1
ENV DOWNLOAD_MODELS="all"
# Install dependencies required for Miniconda
RUN apt-get update -y && \
apt-get install -y wget bzip2 ca-certificates git curl && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
emacs \
git \
jq \
libcurl4-openssl-dev \
libglib2.0-0 \
libgl1-mesa-glx \
libsm6 \
libssl-dev \
libxext6 \
libxrender-dev \
software-properties-common \
openssh-server \
openssh-client \
git-lfs \
vim \
zip \
unzip \
zlib1g-dev \
libc6-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Download and install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
bash miniconda.sh -b -p $CONDA_DIR && \
rm miniconda.sh && \
$CONDA_DIR/bin/conda init bash
# Create environment with Python 3.12 and MPI
RUN $CONDA_DIR/bin/conda create -n pyenv python=3.12 -y && \
$CONDA_DIR/bin/conda install -n pyenv -c conda-forge openmpi mpi4py -y
# Define PyTorch versions via arguments
ARG PYTORCH="2.5.1"
ARG CUDA="124"
# Install PyTorch with specified version and CUDA
RUN $CONDA_DIR/bin/conda run -n pyenv \
pip install torch==$PYTORCH torchvision torchaudio --index-url https://download.pytorch.org/whl/cu$CUDA
RUN $CONDA_DIR/bin/conda install -n pyenv nvidia/label/cuda-12.4.1::cuda-nvcc
# Install git lfs
RUN apt-get update && apt-get install -y git-lfs && git lfs install
# Install nginx
RUN apt-get update && \
apt-get install -y nginx
COPY docker/default /etc/nginx/sites-available/default
# Add Jupyter Notebook
RUN pip install jupyterlab ipywidgets jupyter-archive jupyter_contrib_nbextensions nodejs
RUN pip install -U "huggingface_hub[cli]"
EXPOSE 8888
# Tensorboard
# EXPOSE 6006
# Debug
# RUN $CONDA_DIR/bin/conda run -n pyenv \
# pip install debugpy
# EXPOSE 5678
# Copy the entire project
COPY --chmod=755 . /YuE-Interface
COPY --chmod=755 docker/initialize.sh /initialize.sh
COPY --chmod=755 docker/entrypoint.sh /entrypoint.sh
# Expose the Gradio port
EXPOSE $GRADIO_PORT
CMD [ "/initialize.sh" ]