zap-stream-core/Dockerfile

37 lines
913 B
Docker
Raw Normal View History

2024-03-26 23:15:38 +00:00
ARG IMAGE=rust:bookworm
2024-03-20 22:46:19 +00:00
2024-11-13 19:58:36 +00:00
FROM $IMAGE AS build
2024-03-26 23:15:38 +00:00
WORKDIR /app/src
ENV FFMPEG_DIR=/app/ffmpeg
COPY . .
RUN apt update && \
apt install -y \
build-essential \
libx264-dev \
nasm \
libclang-dev && \
rm -rf /var/lib/apt/lists/*
RUN git clone --depth=1 https://git.ffmpeg.org/ffmpeg.git && \
cd ffmpeg && \
./configure \
--prefix=$FFMPEG_DIR \
--disable-programs \
--disable-doc \
--disable-network \
--enable-gpl \
--enable-version3 \
2024-11-13 18:53:39 +00:00
--disable-postproc \
2024-03-26 23:15:38 +00:00
--enable-libx264 \
--disable-static \
--enable-shared && \
2024-11-13 18:53:39 +00:00
make -j$(nproc) && make install
2024-11-13 19:57:36 +00:00
RUN cargo install --path . --bin zap-stream-core --root /app/build
2024-03-26 23:15:38 +00:00
2024-11-13 19:58:36 +00:00
FROM $IMAGE AS runner
2024-03-26 23:15:38 +00:00
WORKDIR /app
RUN apt update && \
apt install -y libx264-164 && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /app/build .
COPY --from=build /app/ffmpeg/lib/ /lib
ENTRYPOINT ["/app/bin/stream-core"]