59 lines
1.5 KiB
Text
59 lines
1.5 KiB
Text
|
FROM alpine AS builder
|
||
|
|
||
|
RUN apk add --no-cache cargo
|
||
|
|
||
|
RUN mkdir /src
|
||
|
COPY . /src
|
||
|
WORKDIR /src
|
||
|
|
||
|
RUN cargo build --release --no-default-features
|
||
|
|
||
|
# ##############################################
|
||
|
|
||
|
FROM alpine
|
||
|
|
||
|
ARG ffmpeg_ver=7.0
|
||
|
|
||
|
RUN apk add --no-cache \
|
||
|
dav1d fontconfig freetype harfbuzz librsvg libva lilv-libs opus svt-av1 x264-libs x265 \
|
||
|
inkscape libgcc \
|
||
|
&& apk add --no-cache --virtual .build-deps \
|
||
|
build-base \
|
||
|
dav1d-dev fontconfig-dev freetype-dev harfbuzz-dev librsvg-dev libva-dev lilv-dev opus-dev svt-av1-dev x264-dev x265-dev \
|
||
|
&& wget -q https://ffmpeg.org/releases/ffmpeg-${ffmpeg_ver}.tar.bz2 \
|
||
|
&& tar xfa ffmpeg-${ffmpeg_ver}.tar.bz2 \
|
||
|
&& cd ffmpeg-${ffmpeg_ver} \
|
||
|
&& ./configure \
|
||
|
--prefix=/usr/local \
|
||
|
--disable-asm \
|
||
|
--disable-librtmp \
|
||
|
--disable-lzma \
|
||
|
--disable-static \
|
||
|
--enable-avfilter \
|
||
|
--enable-gpl \
|
||
|
--enable-libdav1d \
|
||
|
--enable-libfontconfig \
|
||
|
--enable-libfreetype \
|
||
|
--enable-libharfbuzz \
|
||
|
--enable-libopus \
|
||
|
--enable-librsvg \
|
||
|
--enable-libsvtav1 \
|
||
|
--enable-libx264 \
|
||
|
--enable-libx265 \
|
||
|
--enable-lto=auto \
|
||
|
--enable-lv2 \
|
||
|
--enable-pic \
|
||
|
--enable-postproc \
|
||
|
--enable-pthreads \
|
||
|
--enable-shared \
|
||
|
--enable-vaapi \
|
||
|
--enable-version3 \
|
||
|
--optflags="-O3" \
|
||
|
&& make -j$(nproc) install \
|
||
|
&& apk del --no-cache .build-deps \
|
||
|
&& cd .. \
|
||
|
&& rm -r ffmpeg-${ffmpeg_ver} ffmpeg-${ffmpeg_ver}.tar.bz2
|
||
|
COPY --from=builder /src/target/release/render_video /usr/local/bin/render_video
|
||
|
|
||
|
ENTRYPOINT ["/usr/local/bin/render_video"]
|