Dockerfile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ARG DOTNET_VERSION=3.1
  2. ARG FFMPEG_VERSION=latest
  3. FROM node:alpine as web-builder
  4. ARG JELLYFIN_WEB_VERSION=master
  5. RUN apk add curl \
  6. && curl -L https://github.com/jellyfin/jellyfin-web/archive/${JELLYFIN_WEB_VERSION}.tar.gz | tar zxf - \
  7. && cd jellyfin-web-* \
  8. && yarn install \
  9. && yarn build \
  10. && mv dist /dist
  11. FROM mcr.microsoft.com/dotnet/core/sdk:${DOTNET_VERSION}-buster as builder
  12. WORKDIR /repo
  13. COPY . .
  14. ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
  15. # because of changes in docker and systemd we need to not build in parallel at the moment
  16. # see https://success.docker.com/article/how-to-reserve-resource-temporarily-unavailable-errors-due-to-tasksmax-setting
  17. RUN dotnet publish Jellyfin.Server --disable-parallel --configuration Release --output="/jellyfin" --self-contained --runtime linux-x64 "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
  18. FROM jellyfin/ffmpeg:${FFMPEG_VERSION} as ffmpeg
  19. FROM debian:buster-slim
  20. COPY --from=ffmpeg /opt/ffmpeg /opt/ffmpeg
  21. COPY --from=builder /jellyfin /jellyfin
  22. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  23. # Install dependencies:
  24. # libfontconfig1: needed for Skia
  25. # libgomp1: needed for ffmpeg
  26. # libva-drm2: needed for ffmpeg
  27. # mesa-va-drivers: needed for VAAPI
  28. RUN apt-get update \
  29. && apt-get install --no-install-recommends --no-install-suggests -y \
  30. libfontconfig1 libgomp1 libva-drm2 mesa-va-drivers openssl ca-certificates \
  31. && apt-get clean autoclean \
  32. && apt-get autoremove \
  33. && rm -rf /var/lib/apt/lists/* \
  34. && mkdir -p /cache /config /media \
  35. && chmod 777 /cache /config /media \
  36. && ln -s /opt/ffmpeg/bin/ffmpeg /usr/local/bin \
  37. && ln -s /opt/ffmpeg/bin/ffprobe /usr/local/bin
  38. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  39. EXPOSE 8096
  40. VOLUME /cache /config /media
  41. ENTRYPOINT ["./jellyfin/jellyfin", \
  42. "--datadir", "/config", \
  43. "--cachedir", "/cache", \
  44. "--ffmpeg", "/usr/local/bin/ffmpeg"]