Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ARG DOTNET_VERSION=2
  2. # Download ffmpeg first to allow quicker rebuild of other layers
  3. FROM alpine as ffmpeg
  4. ARG FFMPEG_URL=https://www.johnvansickle.com/ffmpeg/old-releases/ffmpeg-4.0.3-64bit-static.tar.xz
  5. RUN wget ${FFMPEG_URL} -O - | tar Jxf - \
  6. && mkdir ffmpeg-bin \
  7. && mv ffmpeg*/ffmpeg ffmpeg-bin \
  8. && mv ffmpeg*/ffprobe ffmpeg-bin
  9. FROM microsoft/dotnet:${DOTNET_VERSION}-sdk as builder
  10. WORKDIR /repo
  11. COPY . .
  12. RUN export DOTNET_CLI_TELEMETRY_OPTOUT=1 \
  13. && dotnet clean \
  14. && dotnet publish \
  15. --configuration release \
  16. --output /jellyfin \
  17. Jellyfin.Server
  18. FROM microsoft/dotnet:${DOTNET_VERSION}-runtime
  19. COPY --from=builder /jellyfin /jellyfin
  20. COPY --from=ffmpeg /ffmpeg-bin/* /usr/bin/
  21. EXPOSE 8096
  22. VOLUME /config /media
  23. # libfontconfig1 is required for Skia
  24. RUN apt-get update \
  25. && apt-get install --no-install-recommends --no-install-suggests -y \
  26. libfontconfig1 \
  27. && apt-get clean autoclean \
  28. && apt-get autoremove \
  29. && rm -rf /var/lib/{apt,dpkg,cache,log}
  30. ENTRYPOINT dotnet /jellyfin/jellyfin.dll -programdata /config