-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
82 lines (73 loc) · 3.29 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
# Base Image
FROM debian:12.2
ENV ZM_DB_HOST=mariadb
ENV ZM_DB_NAME=zm
ENV ZM_DB_USER=zmuser
ENV ZM_DB_PASS=zmpass
# this is just a default
ENV TZ=America/New_York
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update \
&& apt-get upgrade --yes \
&& apt-get install --yes \
apache2 \
build-essential \
cpanminus \
ffmpeg \
gifsicle \
git \
gnupg2 \
libapache2-mod-php \
libconfig-inifiles-perl \
libcrypt-mysql-perl \
libcrypt-eksblowfish-perl \
libmodule-build-perl \
libyaml-perl \
libjson-perl \
liblwp-protocol-https-perl \
libgeos-dev \
lsb-release \
mariadb-client \
php \
php-mysql \
python3-pip \
python3-requests \
python3-opencv \
s6 \
wget \
zoneminder \
&& /usr/bin/pip install --break-system-packages pyzm \
&& apt-get clean \
&& a2enmod rewrite \
&& a2enmod cgi \
&& a2enmod headers \
&& a2enmod expires
RUN /usr/bin/cpanm -i 'Net::WebSocket::Server'
COPY ./content/ /tmp/
RUN install -m 0644 -o root -g root /tmp/zm-site.conf /etc/apache2/sites-available/zm-site.conf \
&& install -m 0644 -o www-data -g www-data /tmp/zmcustom.conf /etc/zm/conf.d/zmcustom.conf \
&& install -m 0755 -o root -g root -d /etc/services.d /etc/services.d/zoneminder /etc/services.d/apache2 \
&& install -m 0755 -o root -g root /tmp/zoneminder-run /etc/services.d/zoneminder/run \
&& install -m 0755 -o root -g root /tmp/zoneminder-finish /etc/services.d/zoneminder/finish \
&& install -m 0755 -o root -g root /tmp/apache2-run /etc/services.d/apache2/run \
&& install -m 0644 -o root -g root /tmp/status.conf /etc/apache2/mods-available/status.conf \
&& a2dissite 000-default \
&& a2ensite zm-site \
&& bash -c 'install -m 0755 -o www-data -g www-data -d /var/lib/zmeventnotification /var/lib/zmeventnotification/{bin,contrib,images,mlapi,known_faces,unknown_faces,misc,push}' \
&& install -m 0755 -o www-data -g www-data /tmp/zmeventnotification/zmeventnotification.pl /usr/bin/zmeventnotification.pl \
&& install -m 0755 -o www-data -g www-data /tmp/zmeventnotification/pushapi_plugins/pushapi_pushover.py /var/lib/zmeventnotification/bin/pushapi_pushover.py \
&& install -m 0755 -o www-data -g www-data /tmp/zmeventnotification/hook/zm_event_start.sh /var/lib/zmeventnotification/bin/zm_event_start.sh \
&& install -m 0755 -o www-data -g www-data /tmp/zmeventnotification/hook/zm_event_end.sh /var/lib/zmeventnotification/bin/zm_event_end.sh \
&& install -m 0755 -o www-data -g www-data /tmp/zmeventnotification/hook/zm_detect.py /var/lib/zmeventnotification/bin/zm_detect.py \
&& install -m 0755 -o www-data -g www-data /tmp/zmeventnotification/hook/zm_train_faces.py /var/lib/zmeventnotification/bin/zm_train_faces.py \
&& pip install --break-system-packages newrelic \
&& cd /tmp/zmeventnotification/hook && pip -v install --break-system-packages . \
&& rm -Rf /tmp/*
VOLUME /var/cache/zoneminder
VOLUME /var/log/zm
# Copy entrypoint make it as executable and run it
COPY entrypoint.sh /opt/
RUN chmod +x /opt/entrypoint.sh
ENTRYPOINT [ "/bin/bash", "-c", "source ~/.bashrc && /opt/entrypoint.sh ${@}", "--" ]
EXPOSE 80
EXPOSE 9000