-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build ffmpeg from source for ytdlp image
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# youtube-dl Server Dockerfile | ||
# | ||
# https://github.com/nbr23/youtube-dl-server | ||
# | ||
|
||
FROM alpine as ffmpeg | ||
|
||
WORKDIR /ffmpeg | ||
|
||
RUN apk add wget && \ | ||
if [ "$(uname -m)" == "x86_64" ]; then \ | ||
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz; \ | ||
elif [ "$(uname -m)" == "aarch64" ]; then \ | ||
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-arm64-static.tar.xz; \ | ||
elif [ "$(uname -m)" == "armv7l" ]; then \ | ||
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-armhf-static.tar.xz; \ | ||
else \ | ||
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-$(uname -m)-static.tar.xz; \ | ||
fi \ | ||
&& tar -xvf ffmpeg-git-*-static.tar.xz && cd ffmpeg-git-*-static && mv ffmpeg ffprobe ../ | ||
|
||
FROM python:alpine3.13 | ||
ARG YOUTUBE_DL=youtube_dl | ||
ARG ATOMICPARSLEY=0 | ||
ARG YDL_PYTHONPATH='/youtube-dl/.python' | ||
|
||
VOLUME "/youtube-dl" | ||
VOLUME "/app_config" | ||
|
||
COPY --from=nbr23/youtube-dl-wheels /out/wheels /wheels | ||
RUN pip install --no-cache /wheels/* | ||
|
||
RUN mkdir -p /usr/src/app | ||
COPY --from=ffmpeg /ffmpeg/ffmpeg /usr/local/bin/ffmpeg | ||
COPY --from=ffmpeg /ffmpeg/ffprobe /usr/local/bin/ffprobe | ||
RUN apk add --no-cache tzdata mailcap | ||
RUN if [ $ATOMICPARSLEY == 1 ]; then apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing atomicparsley; ln /usr/bin/atomicparsley /usr/bin/AtomicParsley; fi | ||
COPY ./requirements.txt /usr/src/app/ | ||
RUN pip install --upgrade pip && sed -i s/youtube-dl/${YOUTUBE_DL}/ /usr/src/app/requirements.txt && pip install --no-cache-dir -r /usr/src/app/requirements.txt | ||
|
||
COPY ./bootstrap.sh /usr/src/app/ | ||
COPY ./docker_run.sh /usr/src/app/ | ||
COPY ./config.yml /usr/src/app/default_config.yml | ||
COPY ./ydl_server /usr/src/app/ydl_server | ||
COPY ./youtube-dl-server.py /usr/src/app/ | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN apk add --no-cache wget && ./bootstrap.sh && apk del wget | ||
|
||
|
||
EXPOSE 8080 | ||
|
||
ENV YOUTUBE_DL=$YOUTUBE_DL | ||
ENV YDL_CONFIG_PATH='/app_config' | ||
ENV YDL_PYTHONPATH=$YDL_PYTHONPATH | ||
CMD [ "./docker_run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters