From 73eda722f84aa26eb58553f52b2899ab8c9a383a Mon Sep 17 00:00:00 2001 From: NijiNeko <125987288+nijinekoyo@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:01:20 +0800 Subject: [PATCH] Optimizing the Docker deployment process (#456) --- docker/Dockerfile => Dockerfile | 9 ++++++--- README.md | 4 ++-- docs/zh_CN/README.md | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) rename docker/Dockerfile => Dockerfile (82%) diff --git a/docker/Dockerfile b/Dockerfile similarity index 82% rename from docker/Dockerfile rename to Dockerfile index 96632a1..5740556 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -5,6 +5,11 @@ LABEL org.opencontainers.image.source = "https://github.com/hpcaitech/Open-Sora" LABEL org.opencontainers.image.licenses = "Apache License 2.0" LABEL org.opencontainers.image.base.name = "docker.io/library/hpcaitech/pytorch-cuda:2.1.0-12.1.0" +# Set the working directory +WORKDIR /workspace/Open-Sora +# Copy the current directory contents into the container at /workspace/Open-Sora +COPY . . + # inatall library dependencies RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y @@ -18,6 +23,4 @@ RUN pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolati RUN pip install xformers --index-url https://download.pytorch.org/whl/cu121 # install this project -RUN git clone https://github.com/hpcaitech/Open-Sora && \ - cd Open-Sora && \ - pip install -v . +RUN pip install -v . diff --git a/README.md b/README.md index 1c0f4de..42201f6 100644 --- a/README.md +++ b/README.md @@ -203,13 +203,13 @@ pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation - Run the following command to build a docker image from Dockerfile provided. ```bash -docker build -t opensora ./docker +docker build -t opensora . ``` Run the following command to start the docker container in interactive mode. ```bash -docker run -ti --gpus all -v {MOUNT_DIR}:/data opensora +docker run -ti --gpus all -v .:/workspace/Open-Sora opensora ``` ## Model Weights diff --git a/docs/zh_CN/README.md b/docs/zh_CN/README.md index 43753e3..f9df7ac 100644 --- a/docs/zh_CN/README.md +++ b/docs/zh_CN/README.md @@ -175,13 +175,13 @@ pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation - 运行以下命令从提供的Dockerfile 构建docker 镜像。 ```bash -docker build -t opensora ./docker +docker build -t opensora . ``` 运行以下命令以交互模式启动docker容器。 ```bash -docker run -ti --gpus all -v {MOUNT_DIR}:/data opensora +docker run -ti --gpus all -v .:/workspace/Open-Sora opensora ``` ## 模型权重