2024-05-26 09:47:53 +00:00
|
|
|
FROM alpine:3.20
|
2024-05-18 21:24:09 +00:00
|
|
|
|
|
|
|
ARG ffmpeg_ver=7.0
|
|
|
|
|
2024-05-26 09:33:25 +00:00
|
|
|
RUN mkdir -p /usr/local/src/render_video
|
|
|
|
COPY LICENSE /usr/local/src/render_video/LICENSE
|
|
|
|
COPY Cargo.toml /usr/local/src/render_video/Cargo.toml
|
|
|
|
COPY Cargo.lock /usr/local/src/render_video/Cargo.lock
|
|
|
|
COPY src /usr/local/src/render_video/src
|
|
|
|
COPY assets /usr/local/src/render_video/assets
|
|
|
|
|
2024-05-18 21:24:09 +00:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
dav1d fontconfig freetype harfbuzz librsvg libva lilv-libs opus svt-av1 x264-libs x265 \
|
2024-05-20 15:34:08 +00:00
|
|
|
font-noto inkscape libarchive-tools libgcc \
|
2024-05-18 21:24:09 +00:00
|
|
|
&& apk add --no-cache --virtual .build-deps \
|
2024-05-26 09:33:25 +00:00
|
|
|
build-base cargo pkgconf \
|
2024-05-18 21:24:09 +00:00
|
|
|
dav1d-dev fontconfig-dev freetype-dev harfbuzz-dev librsvg-dev libva-dev lilv-dev opus-dev svt-av1-dev x264-dev x265-dev \
|
2024-05-26 09:33:25 +00:00
|
|
|
# build the render_video project
|
|
|
|
&& cargo install --path /usr/local/src/render_video --root /usr/local --no-default-features \
|
2024-05-26 09:47:53 +00:00
|
|
|
&& rm -rf ~/.cargo \
|
2024-05-26 09:33:25 +00:00
|
|
|
# we install ffmpeg ourselves to get libsvtav1 support which is not part of the alpine package \
|
2024-05-18 21:24:09 +00:00
|
|
|
&& 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 .. \
|
2024-05-20 15:34:08 +00:00
|
|
|
&& rm -r ffmpeg-${ffmpeg_ver} ffmpeg-${ffmpeg_ver}.tar.bz2 \
|
|
|
|
# we need Arial Black for the VideoAG logo \
|
|
|
|
&& wget -q https://www.freedesktop.org/software/fontconfig/webfonts/webfonts.tar.gz \
|
|
|
|
&& tar xfa webfonts.tar.gz \
|
|
|
|
&& cd msfonts \
|
|
|
|
&& for file in *.exe; do bsdtar xf "$file"; done \
|
|
|
|
&& install -Dm644 -t /usr/share/fonts/msfonts/ *.ttf *.TTF \
|
|
|
|
&& install -Dm644 -t /usr/share/licenses/msfonts/ Licen.TXT \
|
|
|
|
&& cd .. \
|
|
|
|
&& rm -r msfonts webfonts.tar.gz
|
2024-05-18 21:24:09 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/render_video"]
|