Files
AudioManager/Dockerfile
T
TapTap 89e6b0c025
CI / chart (push) Successful in 2s
CI / test (push) Successful in 2m3s
CI / chart-push (push) Successful in 5s
CI / image (push) Successful in 3m42s
build: retry the yt-dlp download in the image build
The release download from github.com occasionally resets the connection on
the runner, which failed the image job twice in a row while test and chart
passed. Retry the fetch and bound the connect time.
2026-11-22 17:53:20 +00:00

55 lines
1.5 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
ARG STREAMRIP_VERSION=2.1.0
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
ffmpeg \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL --retry 5 --retry-delay 3 --retry-all-errors \
--connect-timeout 20 \
"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 \
&& pip3 install --no-cache-dir "streamrip==${STREAMRIP_VERSION}" \
&& yt-dlp --version \
&& rip --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 \
MEDIA_DIR=/data/media \
DOWNLOAD_DIR=/data/downloads \
USERS_FILE=/etc/musicmanager/users.yaml \
FFMPEG_PATH=ffmpeg \
YTDLP_PATH=yt-dlp \
STREAMRIP_PATH=rip \
DEFAULT_SOURCE=deezer \
DEEZER_QUALITY=0 \
PORT=8080
USER 10001:10001
EXPOSE 8080
ENTRYPOINT ["java", "-XX:+UseSerialGC", "-Xmx256m", "-jar", "/app/musicmanager.jar"]