diff --git a/Dockerfile b/Dockerfile index 5e9fef0e7..5bb5ddd72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,37 @@ +FROM debian:bookworm-slim AS builder + +ENV DEBIAN_FRONTEND=noninteractive \ + PREFIX=/usr/local + +RUN apt-get update && apt-get install -y \ + autoconf automake build-essential cmake git \ + libass-dev libfreetype6-dev libgnutls28-dev \ + libmp3lame-dev libopus-dev libvorbis-dev \ + libvpx-dev libx264-dev libx265-dev \ + libtool pkg-config texinfo wget yasm nasm \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /tmp/ffmpeg +RUN wget -O ffmpeg-snapshot.tar.bz2 https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ + tar xjf ffmpeg-snapshot.tar.bz2 && \ + cd ffmpeg && \ + ./configure \ + --prefix=${PREFIX} \ + --enable-gpl \ + --enable-gnutls \ + --enable-libass \ + --enable-libfreetype \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libx264 \ + --enable-libx265 \ + --enable-nonfree \ + --enable-version3 && \ + make -j$(nproc) && \ + make install + FROM python:3.13.5-slim-bookworm COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ @@ -8,8 +42,13 @@ WORKDIR /app COPY pyproject.toml . # 编译器 -RUN apt-get update && apt-get install -y build-essential +RUN apt-get update && apt-get install -y build-essential \ + libass9 libfreetype6 libgnutls30 libmp3lame0 \ + libopus0 libvorbis0a libvorbisenc2 libvpx7 \ + libx264-164 libx265-199 +COPY --from=builder /usr/local /usr/local +RUN ldconfig && ffmpeg -version # 安装依赖 RUN uv sync