Add Docker configuration
This commit is contained in:
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
||||
/.venv
|
||||
dist
|
||||
__pycache__/
|
||||
8
.env-docker
Normal file
8
.env-docker
Normal 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
35
Dockerfile
Normal 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
16
docker-run.sh
Executable 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}"
|
||||
Reference in New Issue
Block a user