-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
119 lines (106 loc) · 5.89 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
FROM ubuntu:24.04 as comskipbuild
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /tmp
RUN apt-get -q update &&\
apt-get install -y autoconf libtool git build-essential libargtable2-dev libavformat-dev libsdl1.2-dev libswscale-dev
RUN git clone https://github.com/erikkaashoek/Comskip --branch master --single-branch
RUN cd Comskip &&\
git reset 109b5d10b086d299d7e43878ccc7951cb7133ed8 --hard
RUN cd Comskip &&\
./autogen.sh &&\
./configure &&\
make &&\
make install
FROM ubuntu:24.04 as ccbuild
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /tmp
RUN apt-get -q update &&\
apt-get install -y autoconf libtool git build-essential libglew-dev libglfw3-dev cmake gcc libcurl4-gnutls-dev tesseract-ocr libtesseract-dev libleptonica-dev clang libclang-dev
RUN git clone https://github.com/CCExtractor/ccextractor --branch master --single-branch
RUN cd ccextractor &&\
git reset v0.94 --hard
RUN cd ccextractor/linux &&\
./build -without-rust &&\
./ccextractor --version &&\
cp ccextractor /usr/local/bin
FROM ubuntu:24.04
ARG SYSTEMCTL_VER=ac9b3916dd069ba053e4259cf74131028935f5e1
ENV DEBIAN_FRONTEND=noninteractive
COPY requirements.txt /tmp/
# mono-* deps line must match Subtitle-Edit version
# hunspell needed for Subtitle-Edit
# vosk doesn't install libatomic1 dep on aarch64
RUN apt-get -q update && \
apt-get install -y software-properties-common && \
apt-get install -qy zsh ffmpeg x264 x265 imagemagick vainfo curl python3 python3-pip python3-dev cron anacron sshfs vim-tiny mkvtoolnix unzip logrotate jq less default-jre rsync \
mono-runtime libmono-system-windows-forms4.0-cil libmono-system-net-http-webrequest4.0-cil mono-devel libhunspell-dev hunspell-en-us tesseract-ocr-eng xserver-xorg-video-dummy libgtk2.0-0 \
libargtable2-0 libavformat60 libsdl1.2-compat libatomic1 &&\
pip --no-input install --break-system-packages --compile --ignore-installed -r /tmp/requirements.txt && \
apt-get remove -y python3-pip software-properties-common &&\
apt-get autoremove -y &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/* &&\
find /etc/cron.*/* -type f -not -name "*logrotate*" -not -name "*anacron*" -delete &&\
rm -rf /tmp/*
RUN curl -o /tmp/se.zip -L "https://github.com/SubtitleEdit/subtitleedit/releases/download/4.0.8/SE408.zip" &&\
unzip -d /usr/share/subtitle-edit /tmp/se.zip &&\
rm /tmp/se.zip &&\
curl -L -o /usr/bin/systemctl https://github.com/gdraheim/docker-systemctl-replacement/raw/${SYSTEMCTL_VER}/files/docker/systemctl3.py &&\
chmod +x /usr/bin/systemctl &&\
useradd -g 100 -u 99 plex
# Settings.xml is generated by running SubtitleEdit.exe and exiting. If re-generating, compare settings. Ensure that the subtitle PNGs are not transparent.
COPY SubtitleEdit-Settings.xml /usr/share/subtitle-edit/Settings.xml
ADD subtitle-edit /usr/local/bin/
COPY --from=comskipbuild /usr/local/bin/comskip /usr/local/bin
COPY --from=ccbuild /usr/local/bin/ccextractor /usr/local/bin
ADD dvrprocess /usr/local/share/dvrprocess/
RUN find /usr/local/share/dvrprocess -name "*.py" -print0 | xargs -r0 python3 -OO -m py_compile
ADD xorg-dummy.conf /etc/
COPY dvrprocess/comskip*.ini dvrprocess/media-hare.defaults.ini dvrprocess/media-hare.ini /etc/
COPY tvshow-summary.sh /etc/cron.daily/tvshow-summary
#COPY comchap-apply.sh /etc/cron.daily/comchap-apply
COPY comtune-apply.sh /etc/cron.daily/comtune-apply
COPY transcode-apply.sh /etc/cron.hourly/transcode-apply
COPY media-errors.sh /etc/cron.daily/media-errors
COPY profanity-filter-apply.sh /etc/cron.daily/profanity-filter-apply
COPY clean-orphaned-files.sh /etc/cron.weekly/clean-orphaned-files
COPY logrotate.conf /etc/logrotate.d/dvr
COPY sendmail-log.sh /usr/sbin/sendmail
COPY healthcheck.sh /usr/bin/
COPY entrypoint.sh /
COPY hwaccel-drivers.sh /usr/bin/hwaccel-drivers
COPY hwaccel-drivers-wrapper.sh /usr/bin/hwaccel-drivers-wrapper
COPY anacron.cron /etc/cron.d/anacron
ADD *.service /etc/systemd/system/
RUN chmod 0644 /etc/logrotate.d/dvr &&\
find /etc/cron* -type f -print0 | xargs -r0 chmod 0755 &&\
ln -s /usr/local/share/dvrprocess/dvr_post_process.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/profanity_filter.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/profanity-filter-apply.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/profanity-filter-report.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/comchap-apply.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/comchap.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/comtune.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/comcut.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/scene-extract.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/edl_normalize.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/find_need_transcode.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/find_need_comcut.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/find_media_errors.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/transcode-apply.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/smart-comcut.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/tvshow-summary.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/tvshow-suspicious.py /usr/local/bin/ &&\
ln -s /usr/local/share/dvrprocess/clean_orphaned_files.py /usr/local/bin/ &&\
chmod +x /usr/local/bin/* /usr/sbin/sendmail /usr/bin/hwaccel-drivers* && \
ln -s /usr/bin/hwaccel-drivers-wrapper /etc/cron.daily/1hwaccel-drivers &&\
systemctl enable cron &&\
systemctl enable xorg-dummy &&\
systemctl enable localtime &&\
systemctl enable environment &&\
systemctl enable hwaccel-drivers &&\
systemctl disable unattended-upgrades &&\
echo "DISPLAY=:0" >> /etc/environment &&\
cat /etc/zsh/newuser.zshrc.recommended > /root/.zshrc
CMD [ "/entrypoint.sh" ]
HEALTHCHECK CMD /usr/bin/healthcheck.sh