Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ARG DOTNET_VERSION=3.0
  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. RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-x64 "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
  16. FROM jellyfin/ffmpeg:${FFMPEG_VERSION} as ffmpeg
  17. FROM debian:buster-slim
  18. COPY --from=ffmpeg /opt/ffmpeg /opt/ffmpeg
  19. COPY --from=builder /jellyfin /jellyfin
  20. COPY --from=web-builder /dist /jellyfin/jellyfin-web
  21. # Install dependencies:
  22. # libfontconfig1: needed for Skia
  23. # libgomp1: needed for ffmpeg
  24. # libva-drm2: needed for ffmpeg
  25. # mesa-va-drivers: needed for VAAPI
  26. RUN apt-get update \
  27. && apt-get install --no-install-recommends --no-install-suggests -y \
  28. libfontconfig1 libgomp1 libva-drm2 mesa-va-drivers openssl \
  29. && apt-get clean autoclean \
  30. && apt-get autoremove \
  31. && rm -rf /var/lib/apt/lists/* \
  32. && mkdir -p /cache /config /media \
  33. && chmod 777 /cache /config /media \
  34. && ln -s /opt/ffmpeg/bin/ffmpeg /usr/local/bin \
  35. && ln -s /opt/ffmpeg/bin/ffprobe /usr/local/bin
  36. ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
  37. EXPOSE 8096
  38. VOLUME /cache /config /media
  39. ENTRYPOINT ["./jellyfin/jellyfin", \
  40. "--datadir", "/config", \
  41. "--cachedir", "/cache", \
  42. "--ffmpeg", "/usr/local/bin/ffmpeg"]