2026-11-23 03:39:34 +02:00
|
|
|
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
|
|
|
|
|
|
2026-11-23 03:54:22 +02:00
|
|
|
# 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
|
2026-05-23 13:18:28 +03:00
|
|
|
|
|
|
|
|
RUN apt-get update \
|
|
|
|
|
&& apt-get install -y --no-install-recommends pkg-config libssl-dev ca-certificates \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
2026-11-18 14:40:16 +00:00
|
|
|
RUN cargo install cargo-chef --version 0.1.74 --locked
|
|
|
|
|
|
2026-05-23 13:18:28 +03:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-11-18 14:40:16 +00:00
|
|
|
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 ./
|
2026-05-23 13:18:28 +03:00
|
|
|
COPY build.rs ./build.rs
|
|
|
|
|
COPY prompts ./prompts
|
|
|
|
|
COPY src ./src
|
|
|
|
|
COPY templates ./templates
|
|
|
|
|
|
2026-11-18 14:40:16 +00:00
|
|
|
RUN cargo build --release --locked --bin furumusic
|
2026-05-23 13:18:28 +03:00
|
|
|
|
2026-08-14 01:21:51 +01:00
|
|
|
FROM denoland/deno:bin-2.8.3 AS deno
|
|
|
|
|
|
2026-11-23 03:54:22 +02:00
|
|
|
FROM debian:trixie-slim
|
2026-05-23 13:18:28 +03:00
|
|
|
|
2026-08-14 01:21:51 +01:00
|
|
|
ARG YT_DLP_VERSION=2026.07.04
|
|
|
|
|
|
2026-05-23 13:18:28 +03:00
|
|
|
RUN apt-get update \
|
2026-08-14 01:21:51 +01:00
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
ffmpeg \
|
2026-10-15 00:29:37 +01:00
|
|
|
libchromaprint-tools \
|
2026-11-23 03:54:22 +02:00
|
|
|
libstdc++6 \
|
2026-08-14 01:21:51 +01:00
|
|
|
python3 \
|
|
|
|
|
python3-pip \
|
|
|
|
|
&& pip3 install --break-system-packages --no-cache-dir --disable-pip-version-check \
|
|
|
|
|
"yt-dlp[default]==${YT_DLP_VERSION}" \
|
2026-05-23 13:18:28 +03:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
WORKDIR /data
|
|
|
|
|
COPY --from=builder /app/target/release/furumusic /usr/local/bin/furumusic
|
2026-08-14 01:21:51 +01:00
|
|
|
COPY --from=deno /deno /usr/local/bin/deno
|
2026-11-23 03:39:34 +02:00
|
|
|
COPY --from=lyrics-model /model /opt/furumusic/models/multilingual-e5-small
|
2026-05-23 13:18:28 +03:00
|
|
|
|
2026-11-23 03:54:22 +02:00
|
|
|
RUN FURU_LOG_LEVEL=error furumusic --version
|
|
|
|
|
|
2026-05-23 13:18:28 +03:00
|
|
|
EXPOSE 8000
|
|
|
|
|
CMD ["furumusic", "-l", "0.0.0.0:8000"]
|