mirror of
https://github.com/rakuri255/UltraSinger.git
synced 2026-11-20 13:07:52 +09:00
try fix docker
This commit is contained in:
1 parent
13a5b83cd2
commit
bf0940693c
1 file changed
+21
-14
+21
-14
@@ -1,30 +1,37 @@
|
||||
FROM nvidia/cuda:12.6.3-runtime-ubuntu22.04
|
||||
|
||||
# note: the python3-pip package contains Python 3.10 on Ubuntu 22.04
|
||||
# note: the python3-pip package contains Python 3.12 on Ubuntu 22.04
|
||||
RUN apt-get update \
|
||||
&& apt-get install git python3-pip python3.10-venv ffmpeg -y \
|
||||
&& apt-get install git python3 python3-venv ffmpeg curl -y \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# copy only the requirements file to leverage container image build cache
|
||||
COPY ./requirements-linux.txt /app/UltraSinger/requirements-linux.txt
|
||||
# Install uv
|
||||
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
ENV PATH="/root/.local/bin:$PATH"
|
||||
ENV UV_LINK_MODE=copy
|
||||
|
||||
# copy pyproject.toml and uv.lock first to leverage container image build cache
|
||||
COPY ./pyproject.toml /app/UltraSinger/pyproject.toml
|
||||
COPY ./uv.lock /app/UltraSinger/uv.lock
|
||||
WORKDIR /app/UltraSinger
|
||||
|
||||
# Sync dependencies from pyproject.toml
|
||||
RUN uv sync
|
||||
|
||||
# Install PyTorch with CUDA support (override the CPU version from pyproject.toml)
|
||||
RUN uv pip install torch==2.8.0 torchvision==0.23.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu128 --force-reinstall
|
||||
|
||||
# copy sources late to allow for caching of layers which contain all the dependencies
|
||||
COPY . /app/UltraSinger
|
||||
|
||||
# no need to run as root
|
||||
RUN chown -R 1000:1000 /app/UltraSinger
|
||||
USER 1000:1000
|
||||
|
||||
# setup venv
|
||||
# Set venv path
|
||||
ENV VIRTUAL_ENV=/app/UltraSinger/.venv
|
||||
RUN python3 -m venv $VIRTUAL_ENV
|
||||
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
|
||||
# install dependencies
|
||||
RUN pip install --no-cache-dir -r requirements-linux.txt \
|
||||
&& pip install --no-cache-dir torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https://download.pytorch.org/whl/cu121 \
|
||||
&& pip install --no-cache-dir tensorflow[and-cuda]==2.16.1
|
||||
|
||||
# copy sources late to allow for caching of layers which contain all the dependencies
|
||||
COPY . /app/UltraSinger
|
||||
WORKDIR /app/UltraSinger/src
|
||||
CMD ["bash" ]
|
||||
CMD ["bash"]
|
||||
Reference in new issue
Block a user