commit f5344a03e6c171cab74a09e985d61faf289fc696 Author: RealStickman Date: Sun Nov 27 17:03:00 2022 +0100 Add dockerfile, readme and gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9093358 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/root/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..7f1efdb --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Building + +1. Download the "root" folder from the [Tdarr Repo (direct link)](https://github.com/HaveAGitGat/Tdarr/tree/master/docker/root) +2. Place this folder in here, next to the dockerfile +3. Build the container. `buildah bud -t tdarr-ffmpeg5.1: -f debian-bullseye.dockerfile` diff --git a/debian-bullseye.dockerfile b/debian-bullseye.dockerfile new file mode 100644 index 0000000..28d622b --- /dev/null +++ b/debian-bullseye.dockerfile @@ -0,0 +1,86 @@ +FROM docker.io/lsiobase/ubuntu:focal + +ARG VERSION="2.00.19" +ARG MODULE="Tdarr_Server" + +ENV \ + LIBVA_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri" \ + LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu" \ + NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \ + NVIDIA_VISIBLE_DEVICES="all" \ + HANDBRAKE=1.5.1 + +ENV WEB_UI_PORT="8265" SERVER_PORT="8266" NODE_PORT="8267" PUID="1000" PGID="1000" UMASK="002" TZ="Etc/UTC" HOME="/home/Tdarr" + +COPY root/ / + +# handle deps +RUN apt-get update && \ + apt-get install -y \ + software-properties-common \ + git \ + trash-cli && \ + mkdir -p \ + /app \ + /logs \ + /temp \ + "${HOME}" && \ + useradd -u ${PUID} -U -d ${HOME} -s /bin/false Tdarr && \ + usermod -G users Tdarr && \ + + apt-get update && apt-get install -y curl unzip mkvtoolnix libtesseract-dev && \ + if uname -m | grep -q x86; then \ + # FFmpeg + apt install -y wget && \ + wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/5.1.2-4/jellyfin-ffmpeg5_5.1.2-4-focal_amd64.deb && \ + apt install -y \ + ./jellyfin-ffmpeg5_5.1.2-4-focal_amd64.deb && \ + ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg && \ + ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/tdarr-ffmpeg && \ + + # Intel deps + curl -s https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - && \ + echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel-graphics.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + intel-media-va-driver-non-free \ + vainfo \ + mesa-va-drivers; \ + fi + + # former handbrake stuff + + # other architectures + +# handle tdarr binaries +RUN if [ "$MODULE" = "Tdarr_Node" ]; then \ + echo removing /tdarr_server && \ + rm -rdf /etc/services.d/tdarr_server ; \ + fi && \ + + apt-get update && apt-get install -y curl unzip mkvtoolnix libtesseract-dev && \ + if uname -m | grep -q x86; then \ + curl --connect-timeout 120 --retry 5 -o /tmp/$MODULE.zip -L \ + "https://tdarrs.s3.us-west-000.backblazeb2.com/versions/$VERSION/linux_x64/$MODULE.zip" && \ + unzip -q /tmp/$MODULE.zip -d /app/$MODULE -x *.exe && \ + + if [ "$MODULE" = "Tdarr_Server" ]; then \ + curl --connect-timeout 120 --retry 5 -o /tmp/Tdarr_Node.zip -L \ + "https://tdarrs.s3.us-west-000.backblazeb2.com/versions/$VERSION/linux_x64/Tdarr_Node.zip" && \ + unzip -q /tmp/Tdarr_Node.zip -d /app/Tdarr_Node -x *.exe ; \ + fi ; \ + fi && \ + # other architectures + + rm -rdf /tmp/$MODULE.zip && \ + rm -rdf /tmp/Tdarr_Node.zip && \ + trash-empty && \ + apt-get autoremove -y + +# link jellyfin-ffmpeg version 5.1.2 to tdarr node ffmpeg +RUN ln -sf /usr/local/bin/ffmpeg /app/Tdarr_Node/node_modules/ffmpeg-static/ffmpeg + +EXPOSE ${NODE_PORT} +EXPOSE ${WEB_UI_PORT} +EXPOSE ${SERVER_PORT} +ENTRYPOINT ["/init"]