fix(infra): ship alass and the translation backends (#259)
This commit was merged in pull request #259.
This commit is contained in:
+27
-1
@@ -13,12 +13,38 @@ WORKDIR /src
|
||||
COPY . .
|
||||
COPY --from=web /src/web/dist ./web/dist
|
||||
ENV ARR_WEB_DIST=/src/web/dist
|
||||
RUN cargo build --release -p arr-daemon
|
||||
# Every translation backend is a default-off cargo feature (DESIGN.md §15),
|
||||
# so a build without this line ships an image that cannot translate at all.
|
||||
# All four go in: which one is in use is a database setting, and the point of
|
||||
# the feature switches is the build, not the deployment.
|
||||
RUN cargo build --release -p arr-daemon \
|
||||
--features translate-openai,translate-deepl,translate-google,translate-command
|
||||
|
||||
# §15 runs `alass` over every fetched and every translated subtitle, and it is
|
||||
# not in Debian — a release binary is the only way in. Its own stage so the
|
||||
# runtime image needs no download tool, and so a source change does not refetch
|
||||
# it. The digest is pinned: an unverified binary from a release page is not
|
||||
# something to run over the library. The asset is x86-64 only, which is what
|
||||
# this image targets.
|
||||
FROM debian:bookworm-slim AS alass
|
||||
ARG ALASS_VERSION=2.0.0
|
||||
ARG ALASS_SHA256=7bd0b9ae7e035d3ba940eacffb21243614df36231d47f21f0b4ce42001ab7fcd
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN curl -fsSL -o /usr/local/bin/alass \
|
||||
"https://github.com/kaegi/alass/releases/download/v${ALASS_VERSION}/alass-linux64" \
|
||||
&& echo "${ALASS_SHA256} /usr/local/bin/alass" | sha256sum -c - \
|
||||
&& chmod +x /usr/local/bin/alass \
|
||||
&& alass --version
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
# ffmpeg covers both `ffprobe` for arr-probe and the audio extraction `alass`
|
||||
# shells out to.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ffmpeg ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=alass /usr/local/bin/alass /usr/local/bin/alass
|
||||
COPY --from=build /src/target/release/arr /usr/local/bin/arr
|
||||
ENV ARR_BIND_ADDR=0.0.0.0:7878 \
|
||||
ARR_DATABASE_PATH=/data/arr.db
|
||||
|
||||
Reference in New Issue
Block a user