Dockerfile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ARG DOTNET_VERSION=3.1
  2. FROM node:alpine as web-builder
  3. ARG JELLYFIN_WEB_VERSION=10.5.5
  4. RUN apk add curl git \
  5. && git clone --branch release-10.5.z --single-branch https://github.com/jellyfin/jellyfin-web.git \
  6. && cd jellyfin-web \
  7. && git checkout tags/v${JELLYFIN_WEB_VERSION} \
  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 debian:buster-slim
  19. # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
  20. ARG DEBIAN_FRONTEND="noninteractive"
  21. # http://stackoverflow.com/questions/48162574/ddg#49462622
  22. ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
  23. # https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
  24. ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
  25. COPY --from=builder /jellyfin /jellyfin
  26. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  27. # Install dependencies:
  28. # mesa-va-drivers: needed for AMD VAAPI
  29. RUN apt-get update \
  30. && apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gnupg wget apt-transport-https \
  31. && wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add - \
  32. && echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list \
  33. && apt-get update \
  34. && apt-get install --no-install-recommends --no-install-suggests -y \
  35. mesa-va-drivers \
  36. jellyfin-ffmpeg \
  37. openssl \
  38. locales \
  39. && apt-get remove gnupg wget apt-transport-https -y \
  40. && apt-get clean autoclean -y \
  41. && apt-get autoremove -y \
  42. && rm -rf /var/lib/apt/lists/* \
  43. && mkdir -p /cache /config /media \
  44. && chmod 777 /cache /config /media \
  45. && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
  46. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  47. EXPOSE 8096
  48. VOLUME /cache /config /media
  49. ENTRYPOINT ["./jellyfin/jellyfin", \
  50. "--datadir", "/config", \
  51. "--cachedir", "/cache", \
  52. "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]