From 4b2818ef5fe334a2e2e3f4a73e25ebbc219bbcc3 Mon Sep 17 00:00:00 2001 From: mustard Date: Tue, 22 Oct 2024 23:16:54 +0200 Subject: [PATCH] Cleaned up Dockerfile --- Dockerfile | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26476af..8a77d24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,6 @@ FROM alpine:latest -ARG DOTNET_VERSION=8.0 -ARG NODEJS_VERSION=20 - -ARG SOURCE_DIR=/jellyfin -ARG ARTIFACT_DIR=/dist -ARG DOTNET_VERSION -ARG NODEJS_VERSION - -ENV SOURCE_DIR=/jellyfin -ENV ARTIFAVT_DIR=/dist -ENV TYPE=$(PACKAGE_TYPE) -ENV ARCHIVE_TYPES=targz - +# Install dependencies RUN apk --no-cache add -u -f \ wget \ curl \ @@ -36,28 +24,27 @@ RUN apk --no-cache add -u -f \ npm \ ffmpeg +# Fetch jellyfin and jellyfin-web + 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 -RUN dotnet publish jellyfin-server/Jellyfin.Server --configuration Release --self-contained --runtime linux-amd64 --output /home/dist/ -p:DebugSymbols=false -p:DebugType=none -p:UseAppHost=true +# 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-amd64 --output /home/root/dist/ -p:DebugSymbols=false -p:DebugType=none -p:UseAppHost=true + +# Build jellyfin-web WORKDIR /home/root/jellyfin-web RUN npm ci --no-audit --unsafe-perm RUN npm run build:production WORKDIR /home/root -RUN rm -rf /home/dist -RUN mkdir /home/dist - -# Patch jellyfin-server -RUN sed -i '/^\s*NetworkChange\.Network/d' jellyfin-server/src/Jellyfin.Networking/Manager/NetworkManager.cs -#RUN sed -i '/^/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/dist/jellyfin -p DebugSymbols=false -p:DebugType=none -p:UseAppHost=true -RUN mv /home/root/jellyfin-web/dist /home/dist/jellyfin/jellyfin-web +RUN mv /home/root/jellyfin-web/dist /home/root/dist/jellyfin/jellyfin-web -ENTRYPOINT ["/home/dist/jellyfin/jellyfin"] +ENTRYPOINT ["/home/root/dist/jellyfin/jellyfin"]