-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (35 loc) · 2.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM python:3.12-slim
RUN mkdir -p /app
RUN mkdir -p /app/temp
RUN mkdir -p /app/Done
RUN mkdir -p /app/Members
RUN apt-get update && apt-get install --no-install-recommends wget unzip xz-utils procps cron git -y -qq && apt clean -y
RUN wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz && \
tar -C /usr/bin -xvf ffmpeg-master-latest-linux64-gpl.tar.xz --wildcards ffmpeg-master-latest-linux64-gpl/bin/ff* --strip-components 2 && \
rm ffmpeg-master-latest-linux64-gpl.tar.xz && chmod +x /usr/bin/ff*
ARG YTA_VERSION=latest
RUN wget -q "https://github.com/Kethsar/ytarchive/releases/download/${YTA_VERSION}/ytarchive_linux_amd64.zip" && \
unzip ytarchive_linux_amd64.zip -d /usr/bin && chmod +x /usr/bin/ytarchive && \
rm ytarchive_linux_amd64.zip
RUN wget -q "https://github.com/HoloArchivists/ytarchive-raw-go/releases/latest/download/ytarchive-raw-go-linux-amd64" -O /usr/bin/ytarchive-raw-go && chmod +x /usr/bin/ytarchive-raw-go
WORKDIR /app
COPY . .
RUN chmod +x *.py
RUN chmod +x /app/startCron.sh
RUN pip install -q --no-cache-dir -r requirements.txt
# Install youtube-community-tab
RUN pip install -q --no-cache-dir -e "git+https://github.com/HoloArchivists/youtube-community-tab.git#egg=youtube-community-tab&subdirectory=youtube-community-tab"
RUN wget -q -O "/app/ytct.py" https://raw.githubusercontent.com/HoloArchivists/youtube-community-tab/master/ytct.py
RUN apt-get purge git -y && apt-get autopurge -y
#Apply chat_downloader patch
RUN sed -i "s/socs.value.startswith('CAA')/str(socs).startswith('CAA')/g" /usr/local/lib/python*/site-packages/chat_downloader/sites/youtube.py
#Apply patch to yt-dlp youtube extractor to make it work with yta-raw
RUN sed -i '/if fmt.get('\'targetDurationSec\''):$/,/ continue$/s/^/#/' "$(pip show yt-dlp | grep Location | awk '{print $2}')/yt_dlp/extractor/youtube.py"
RUN apt-get purge -y wget unzip xz-utils && apt-get autopurge -y && apt clean -y
ENV VIDEOSCHEDULE='*/2 * * * *'
ENV MEMBERSCHEDULE='*/5 * * * *'
#Setup Crontab
#RUN chown -R root /app/crontab && chmod -R 0644 /app/crontab
#RUN crontab /app/crontab
#ENTRYPOINT [ "cron", "-f" ]
ENTRYPOINT [ "bash", "-c", "/app/startCron.sh" ]