The plain yt-dlp release asset is a Python zipapp and needs python3 in the runtime image. yt-dlp_linux is the self-contained PyInstaller binary, so the image stays minimal and yt-dlp --version verifies it at build time.
41 lines
1.2 KiB
Docker
41 lines
1.2 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM gradle:8.14.3-jdk21 AS build
|
|
WORKDIR /src
|
|
|
|
COPY settings.gradle.kts build.gradle.kts gradle.properties ./
|
|
RUN gradle --no-daemon dependencies > /dev/null
|
|
|
|
COPY src ./src
|
|
RUN gradle --no-daemon shadowJar
|
|
|
|
# glibc (not Alpine/musl): sqlite-jdbc ships no native library for Linux-Musl.
|
|
FROM eclipse-temurin:21-jre-jammy
|
|
|
|
ARG YTDLP_VERSION=2026.10.26
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends ca-certificates curl ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& curl -fsSL "https://github.com/yt-dlp/yt-dlp/releases/download/${YTDLP_VERSION}/yt-dlp_linux" \
|
|
-o /usr/local/bin/yt-dlp \
|
|
&& chmod 0755 /usr/local/bin/yt-dlp \
|
|
&& yt-dlp --version \
|
|
&& groupadd -g 10001 app \
|
|
&& useradd -u 10001 -g app -M -s /usr/sbin/nologin app
|
|
|
|
WORKDIR /app
|
|
COPY --from=build /src/build/libs/*-all.jar /app/musicmanager.jar
|
|
|
|
ENV DATA_DIR=/data \
|
|
LIBRARY_CONFIG=/etc/musicmanager/library.yaml \
|
|
USERS_FILE=/etc/musicmanager/users.yaml \
|
|
FFMPEG_PATH=ffmpeg \
|
|
YTDLP_PATH=yt-dlp \
|
|
PORT=8080
|
|
|
|
USER 10001:10001
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["java", "-XX:+UseSerialGC", "-Xmx256m", "-jar", "/app/musicmanager.jar"]
|