From 9f34d45c06996234c94b725b6220f6ad435c5fc6 Mon Sep 17 00:00:00 2001 From: Jack Cowey Date: Mon, 30 Dec 2019 10:18:36 +0000 Subject: [PATCH] openfaas youtube-dl with a pip update weekly timer for youtube-dl --- Dockerfile | 28 +++++++++++++++++++--------- app.conf | 19 +++++++++++++++++++ requirements.txt | 2 ++ 3 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 app.conf create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 3414079..8821300 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,25 @@ -FROM openfaas/classic-watchdog:0.13.4 as watchdog +FROM openfaas/classic-watchdog:0.18.10 as watchdog +FROM alpine:3.11 -FROM alpine:3.8 -ENTRYPOINT [] +LABEL maintainer="https://github.com/hijak" COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog -RUN apk add --no-cache py-pip bash ca-certificates -RUN pip install --upgrade youtube-dl +RUN apk add --update --no-cache py-pip bash ca-certificates supervisor -COPY entry.sh . -RUN chmod +x entry.sh -ENV fprocess="./entry.sh" +COPY ./requirements.txt /code/requirements.txt +WORKDIR /code +RUN pip install pur +RUN pur -r requirements.txt +RUN pip install -r requirements.txt -CMD ["fwatchdog"] +COPY app.conf /etc/supervisor/conf.d/app.conf + +#Runs every Sunday +RUN echo "0 0 * * 0 /usr/bin/pip install --upgrade youtube-dl" >> /etc/crontabs/root + +COPY entry.sh /entry.sh +RUN chmod +x /entry.sh +ENV fprocess="/entry.sh" + +ENTRYPOINT ["/usr/bin/supervisord","-c", "/etc/supervisor/conf.d/app.conf"] diff --git a/app.conf b/app.conf new file mode 100644 index 0000000..9aa27e9 --- /dev/null +++ b/app.conf @@ -0,0 +1,19 @@ +[supervisord] +nodaemon=true + +[program:crond] +command=/usr/sbin/crond -f +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true +autostart=true +autorestart=true + +[program:watchdog] +command=/usr/bin/fwatchdog +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true +autostart=true +autorestart=true + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f0cc848 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +youtube-dl==2019.12.25 +