mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-20 13:40:33 +00:00
chore: use rust-ffmpeg docker image
This commit is contained in:
@ -1,4 +1,3 @@
|
|||||||
**/target/
|
**/target/
|
||||||
**/.git/
|
**/.git/
|
||||||
**/out/
|
**/out/
|
||||||
**/Dockerfile
|
|
@ -1,46 +1,15 @@
|
|||||||
ARG IMAGE=rust:bookworm
|
FROM voidic/rust-ffmpeg AS build
|
||||||
|
|
||||||
FROM $IMAGE AS build
|
|
||||||
WORKDIR /app/src
|
WORKDIR /app/src
|
||||||
ENV FFMPEG_DIR=/app/ffmpeg
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN apt update && \
|
|
||||||
apt install -y \
|
|
||||||
build-essential \
|
|
||||||
libx264-dev \
|
|
||||||
libx265-dev \
|
|
||||||
libwebp-dev \
|
|
||||||
libpng-dev \
|
|
||||||
nasm \
|
|
||||||
protobuf-compiler \
|
|
||||||
libclang-dev && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
RUN wget -O ffmpeg.tar.gz https://git.v0l.io/ffmpeg/ffmpeg/archive/release/7.1.tar.gz && \
|
|
||||||
tar xfv ffmpeg.tar.gz && \
|
|
||||||
cd ffmpeg && \
|
|
||||||
./configure \
|
|
||||||
--prefix=$FFMPEG_DIR \
|
|
||||||
--disable-programs \
|
|
||||||
--disable-doc \
|
|
||||||
--disable-network \
|
|
||||||
--enable-gpl \
|
|
||||||
--enable-version3 \
|
|
||||||
--disable-postproc \
|
|
||||||
--enable-libx264 \
|
|
||||||
--enable-libx265 \
|
|
||||||
--enable-libwebp \
|
|
||||||
--disable-static \
|
|
||||||
--enable-shared && \
|
|
||||||
make -j$(nproc) && make install
|
|
||||||
ENV LD_LIBRARY_PATH=$FFMPEG_DIR/lib
|
ENV LD_LIBRARY_PATH=$FFMPEG_DIR/lib
|
||||||
RUN cargo test
|
RUN cargo test
|
||||||
RUN cargo install --path ./crates/zap-stream --root /app/build
|
RUN cargo install --path ./crates/zap-stream --root /app/build
|
||||||
|
|
||||||
FROM $IMAGE AS runner
|
FROM rust:bookworm
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt install -y libx264-164 && \
|
apt install -y libx264-164 && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
COPY --from=build /app/build .
|
COPY --from=build /app/build .
|
||||||
COPY --from=build /app/ffmpeg/lib/ /lib
|
COPY --from=build /app/src/ffmpeg/lib/ /lib
|
||||||
ENTRYPOINT ["/app/bin/zap-stream"]
|
ENTRYPOINT ["/app/bin/zap-stream"]
|
Reference in New Issue
Block a user