Cleaned up Dockerfile

This commit is contained in:
mustard 2024-10-22 23:16:54 +02:00
parent 477e9bbd97
commit 4b2818ef5f

View file

@ -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"]