joeverfin/Dockerfile

61 lines
1.8 KiB
Text
Raw Permalink Normal View History

FROM alpine:latest AS build
2024-10-22 22:36:33 +02:00
2024-10-22 23:16:54 +02:00
# Install dependencies
2024-10-22 22:36:33 +02:00
RUN apk --no-cache add -u -f \
curl \
git \
dotnet9-sdk \
nodejs \
npm \
2024-10-22 22:36:33 +02:00
ffmpeg
2024-10-22 23:16:54 +02:00
# Fetch jellyfin and jellyfin-web
2024-10-22 22:36:33 +02:00
WORKDIR /home/root
RUN git clone https://github.com/jellyfin/jellyfin.git
RUN mv jellyfin jellyfin-server
RUN git clone https://github.com/jellyfin/jellyfin-web.git
2024-10-22 23:16:54 +02:00
# Patch jellyfin-server
RUN sed -i '/^\s*NetworkChange\.Network/d' jellyfin-server/src/Jellyfin.Networking/Manager/NetworkManager.cs
RUN dotnet publish jellyfin-server/Jellyfin.Server --configuration Release --self-contained --runtime linux-musl-x64 --output /home/root/dist/jellyfin -p:DebugSymbols=false -p:DebugType=none -p:UseAppHost=true
2024-10-22 23:16:54 +02:00
# Build jellyfin-web
2024-10-22 22:36:33 +02:00
WORKDIR /home/root/jellyfin-web
RUN npm ci --no-audit --unsafe-perm
RUN npm run build:production
WORKDIR /home/root
RUN mv /home/root/dist/jellyfin /jellyfin
RUN mv /home/root/jellyfin-web/dist /jellyfin/jellyfin-web
2024-10-22 22:36:33 +02:00
# Add minimal dependencies
FROM alpine:latest AS runtime
2024-10-22 22:36:33 +02:00
RUN apk --no-cache add -u -f \
ffmpeg \
icu-libs \
icu-data-full \
libstdc++ \
libstdc++6
# Add hardened_malloc
COPY --from=ghcr.io/polarix-containers/hardened_malloc:latest /install /usr/local/lib/
ENV LD_PRELOAD="/usr/local/lib/libhardened_malloc.so"
# Default environment variables for the Jellyfin invocation
ENV DEBIAN_FRONTEND="noninteractive" \
LC_ALL="en_US.UTF-8" \
LANG="en_US.UTF-8" \
LANGUAGE="en_US:en" \
JELLYFIN_DATA_DIR="/config" \
JELLYFIN_CACHE_DIR="/cache" \
JELLYFIN_CONFIG_DIR="/config/config" \
JELLYFIN_LOG_DIR="/config/log" \
JELLYFIN_WEB_DIR="/jellyfin/jellyfin-web" \
JELLYFIN_FFMPEG="/usr/bin/ffmpeg"
# JELLYFIN_FFMPEG="/usr/lib/jellyfin-ffmpeg/ffmpeg"
COPY --from=build /jellyfin /jellyfin
COPY --from=build /jellyfin/jellyfin-web /jellyfin/jellyfin-web
ENTRYPOINT ["/jellyfin/jellyfin"]