diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b76be56 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +/.venv +dist +__pycache__/ diff --git a/.env-docker b/.env-docker new file mode 100644 index 0000000..faf2924 --- /dev/null +++ b/.env-docker @@ -0,0 +1,8 @@ +weight_root=/weights +weight_uvr5_root=/assets/uvr5_weights +index_root=/indices +rmvpe_root=/assets/rmvpe +hubert_path=/assets/hubert_base.pt +save_uvr_path=/assets/uvr5_weights +TEMP=/app/TEMP +pretrained=/assets/pretrained diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..388e4ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM alpine:3.19.1 as assets + +RUN apk add --update \ + bash \ + git \ + git-lfs + +COPY --chmod=755 ./assets-download.sh /assets-download.sh + +RUN /assets-download.sh 88e42f0cb3662ddc0dd263a4814206ce96d53214 assets + +FROM python:3.10.14-bullseye as app + +SHELL [ "/bin/bash", "-c" ] + +RUN apt update && \ + apt install -y \ + libsndfile1 \ + libsndfile1-dev + +COPY --from=assets /assets /assets + +WORKDIR /app + +RUN pip install "poetry==1.7.1" + +COPY ./pyproject.toml . + +RUN poetry install + +COPY ./rvc ./rvc + +COPY ./.env-docker ./.env + +CMD [ "poetry", "run", "poe", "rvc-api" ] diff --git a/docker-run.sh b/docker-run.sh new file mode 100755 index 0000000..a9bf5a7 --- /dev/null +++ b/docker-run.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# Runs RVC API in Docker. + +set -e + +tag="rvc" + +docker build -t "${tag}" . + +docker run -it \ + -p 8000:8000 \ + -v "${PWD}/assets/weights:/weights:ro" \ + -v "${PWD}/assets/indices:/indices:ro" \ + -v "${PWD}/assets/audios:/audios:ro" \ + "${tag}"