Add Docker configuration

This commit is contained in:
Andrey Danilov
2024-05-18 22:45:43 +03:00
parent 75faade7d5
commit 61218ff81f
4 changed files with 62 additions and 0 deletions

3
.dockerignore Normal file
View File

@@ -0,0 +1,3 @@
/.venv
dist
__pycache__/

8
.env-docker Normal file
View File

@@ -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

35
Dockerfile Normal file
View File

@@ -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" ]

16
docker-run.sh Executable file
View File

@@ -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}"