From 919acd90b7da8186655434233dc0bf794bbc6dcd Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Wed, 27 Nov 2019 14:11:25 -0700 Subject: [PATCH] chore: build youtube-dl from source --- Dockerfile | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0d734c..9886959 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,37 @@ +# create build from source +FROM python:3 AS build + +WORKDIR /build + +RUN set -xe \ + && apt-get update -y \ + && apt-get install -y zip pandoc \ + && curl -L https://github.com/ytdl-org/youtube-dl/archive/master.zip -o youtube-dl-master.zip \ + && unzip youtube-dl-master.zip + +WORKDIR /build/youtube-dl-master + +RUN set -xe \ + && make + +# add the build to the web container FROM node:12-alpine -# install youtube-dl +WORKDIR /app + +# copy the build +COPY --from=build /build/youtube-dl-master/youtube-dl /usr/local/bin + +# install dependencies RUN set -xe \ + && chmod a+rx /usr/local/bin/youtube-dl \ && apk add --no-cache ca-certificates \ ffmpeg \ openssl \ python3 \ - && pip3 install --upgrade pip \ - && pip3 install youtube-dl + && ln -s /usr/bin/python3 /usr/bin/python # install app dependencies -WORKDIR /app - RUN npm install -g yarn COPY package.json yarn.lock ./ RUN yarn install