Skip to content

Commit

Permalink
build: revert to using rye instead of uv
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPandir committed May 17, 2024
1 parent ef9a0b1 commit 44612f5
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@ LABEL org.opencontainers.image.title="Silero TTS API server"
LABEL org.opencontainers.image.description="This is a simple server that uses Silero models to convert text to audio files over HTTP"
LABEL org.opencontainers.image.vendor="TwirApp"

# Install all dependencies from requirements.lock
# Install all dependencies from pyproject.toml
# NOTE: Rye is used because you need to determine which version of torch to use +cpu or not
# NOTE: The problem with uv is that it does not read the rye.excluded-dependencies metadata
FROM base as dependencies-installer
WORKDIR /app
RUN <<EOF
apt-get -y update && apt-get -y install curl
apt-get autoremove && apt-get clean
curl -LsSf https://astral.sh/uv/install.sh | sh
ln -s /root/.cargo/bin/uv /usr/local/bin/uv
uv venv

curl -LsSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" RYE_TOOLCHAIN=/usr/local/bin/python3 bash
ln -s /root/.rye/shims/rye /usr/local/bin/rye
rye pin 3.12.2
rye config --set-bool behavior.use-uv=true
EOF
COPY requirements.lock .
RUN --mount=type=cache,target=/root/.cache uv pip install --no-deps -r requirements.lock
COPY pyproject.toml .
RUN --mount=type=cache,target=/root/.cache rye sync --no-dev

# Install all silero models from the Internet or locally if available in the `models` directory
FROM base as models-installer
RUN apt-get -y update && apt-get -y install curl
COPY models models
COPY install_models.sh install_models.sh
RUN chmod -x install_models.sh && bash ./install_models.sh >&2
RUN chmod -x ./install_models.sh && bash ./install_models.sh >&2


FROM base
Expand Down

0 comments on commit 44612f5

Please sign in to comment.