Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ARG DOTNET_VERSION=3.1
  2. ARG FFMPEG_VERSION=latest
  3. FROM node:alpine as web-builder
  4. 10.5.1
  5. RUN apk add curl git \
  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. # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
  21. ARG DEBIAN_FRONTEND="noninteractive"
  22. # http://stackoverflow.com/questions/48162574/ddg#49462622
  23. ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
  24. # https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(Native-GPU-Support)
  25. ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility"
  26. COPY --from=ffmpeg /opt/ffmpeg /opt/ffmpeg
  27. COPY --from=builder /jellyfin /jellyfin
  28. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  29. # Install dependencies:
  30. # libfontconfig1: needed for Skia
  31. # libgomp1: needed for ffmpeg
  32. # libva-drm2: needed for ffmpeg
  33. # mesa-va-drivers: needed for VAAPI
  34. RUN apt-get update \
  35. && apt-get install --no-install-recommends --no-install-suggests -y \
  36. libfontconfig1 \
  37. libgomp1 \
  38. libva-drm2 \
  39. mesa-va-drivers \
  40. openssl \
  41. ca-certificates \
  42. vainfo \
  43. i965-va-driver \
  44. && apt-get clean autoclean -y\
  45. && apt-get autoremove -y\
  46. && rm -rf /var/lib/apt/lists/* \
  47. && mkdir -p /cache /config /media \
  48. && chmod 777 /cache /config /media \
  49. && ln -s /opt/ffmpeg/bin/ffmpeg /usr/local/bin \
  50. && ln -s /opt/ffmpeg/bin/ffprobe /usr/local/bin
  51. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  52. EXPOSE 8096
  53. VOLUME /cache /config /media
  54. ENTRYPOINT ["./jellyfin/jellyfin", \
  55. "--datadir", "/config", \
  56. "--cachedir", "/cache", \
  57. "--ffmpeg", "/usr/local/bin/ffmpeg"]