build: simplified the dockerfile to install ffmpeg via apt
This commit is contained in:
+7
-28
@@ -1,7 +1,6 @@
|
||||
# NodeCast TV Docker Image
|
||||
#
|
||||
# Multi-stage build for FFmpeg with full hardware acceleration support.
|
||||
# Uses linuxserver/ffmpeg which includes NVENC, VAAPI, and QSV.
|
||||
# Uses system FFmpeg with hardware acceleration drivers installed.
|
||||
#
|
||||
# Hardware acceleration:
|
||||
# - VAAPI (Intel/AMD): Mount /dev/dri and add video/render groups
|
||||
@@ -12,15 +11,13 @@
|
||||
# Run with VAAPI: docker run --device /dev/dri:/dev/dri --group-add video ...
|
||||
# Run with NVENC: docker run --gpus all ...
|
||||
|
||||
# Stage 1: Get FFmpeg with all hardware encoders from linuxserver
|
||||
FROM linuxserver/ffmpeg:latest AS ffmpeg
|
||||
|
||||
# Stage 2: Node.js runtime with app
|
||||
FROM node:20-slim
|
||||
|
||||
# Install runtime dependencies for FFmpeg and hardware acceleration
|
||||
# Install FFmpeg, build dependencies, and hardware acceleration drivers
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
# FFmpeg with full codec support
|
||||
ffmpeg \
|
||||
# Build dependencies for better-sqlite3
|
||||
python3 \
|
||||
make \
|
||||
@@ -35,28 +32,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
i965-va-driver \
|
||||
# VA-API utilities for debugging
|
||||
vainfo \
|
||||
# FFmpeg shared library dependencies
|
||||
libx264-164 \
|
||||
libx265-199 \
|
||||
libfdk-aac2 \
|
||||
libvpx7 \
|
||||
libmp3lame0 \
|
||||
libopus0 \
|
||||
libvorbis0a \
|
||||
libass9 \
|
||||
libfreetype6 \
|
||||
libfontconfig1 \
|
||||
libssl3 \
|
||||
# NVIDIA libraries (for NVENC when using --gpus)
|
||||
libnvidia-encode1 \
|
||||
&& rm -rf /var/lib/apt/lists/* || true
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy FFmpeg binaries from linuxserver/ffmpeg
|
||||
COPY --from=ffmpeg /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
|
||||
COPY --from=ffmpeg /usr/local/bin/ffprobe /usr/local/bin/ffprobe
|
||||
|
||||
# Verify FFmpeg works and show hardware encoders
|
||||
RUN ffmpeg -version && ffmpeg -encoders 2>/dev/null | grep -E "vaapi|nvenc|qsv" || echo "Note: HW encoders depend on runtime GPU access"
|
||||
# Verify FFmpeg installed and show version
|
||||
RUN ffmpeg -version && ffmpeg -encoders 2>/dev/null | grep -E "vaapi|nvenc|qsv|libx264" | head -10
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user