Files
furumi-web/Dockerfile
T
ab 62f28066b3
Build and Publish / Build and Publish Docker Image (push) Successful in 5m25s
fix: build and run ONNX Runtime on Debian Trixie
2026-11-23 03:54:22 +02:00

62 lines
1.8 KiB
Docker

FROM python:3.13-slim-bookworm AS lyrics-model
COPY scripts/fetch-lyrics-model.py /fetch-lyrics-model.py
RUN python /fetch-lyrics-model.py /model
# The prebuilt Linux ONNX Runtime needs Trixie's glibc and libstdc++ at link time and at runtime.
FROM rust:1.97.0-trixie AS chef
RUN apt-get update \
&& apt-get install -y --no-install-recommends pkg-config libssl-dev ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN cargo install cargo-chef --version 0.1.74 --locked
WORKDIR /app
FROM chef AS planner
COPY Cargo.toml Cargo.lock ./
COPY build.rs ./build.rs
COPY src ./src
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json ./recipe.json
# Keep compiled dependencies in an ordinary layer exported by CI's registry cache.
RUN cargo chef cook --release --locked --recipe-path recipe.json
COPY Cargo.toml Cargo.lock ./
COPY build.rs ./build.rs
COPY prompts ./prompts
COPY src ./src
COPY templates ./templates
RUN cargo build --release --locked --bin furumusic
FROM denoland/deno:bin-2.8.3 AS deno
FROM debian:trixie-slim
ARG YT_DLP_VERSION=2026.07.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
ffmpeg \
libchromaprint-tools \
libstdc++6 \
python3 \
python3-pip \
&& pip3 install --break-system-packages --no-cache-dir --disable-pip-version-check \
"yt-dlp[default]==${YT_DLP_VERSION}" \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /data
COPY --from=builder /app/target/release/furumusic /usr/local/bin/furumusic
COPY --from=deno /deno /usr/local/bin/deno
COPY --from=lyrics-model /model /opt/furumusic/models/multilingual-e5-small
RUN FURU_LOG_LEVEL=error furumusic --version
EXPOSE 8000
CMD ["furumusic", "-l", "0.0.0.0:8000"]