mirror of https://github.com/Nardo86/zm-docker.git
Timezone issue resolved, updated to 1.36
This commit is contained in:
parent
f98b59c46e
commit
70ca9d3e2f
13
Dockerfile
13
Dockerfile
|
@ -17,15 +17,16 @@ RUN apt-get install -y \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
gnupg \
|
gnupg \
|
||||||
wget \
|
wget \
|
||||||
&& wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add - \
|
msmtp \
|
||||||
&& echo 'deb https://zmrepo.zoneminder.com/debian/release-1.34 buster/' >> /etc/apt/sources.list
|
msmtp-mta
|
||||||
|
|
||||||
|
RUN wget -O - https://zmrepo.zoneminder.com/debian/archive-keyring.gpg | apt-key add - \
|
||||||
|
&& echo 'deb https://zmrepo.zoneminder.com/debian/release-1.36 buster/' >> /etc/apt/sources.list
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
|
||||||
RUN apt-get install -y \
|
RUN apt-get install -y \
|
||||||
zoneminder \
|
zoneminder
|
||||||
msmtp \
|
|
||||||
msmtp-mta
|
|
||||||
|
|
||||||
RUN adduser www-data video
|
RUN adduser www-data video
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ RUN a2enmod ssl \
|
||||||
RUN mkdir /config
|
RUN mkdir /config
|
||||||
|
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
run chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
VOLUME /config
|
VOLUME /config
|
||||||
|
|
|
@ -43,9 +43,10 @@ Just run the image publishing the port and setting the ENV variables, the shm de
|
||||||
|
|
||||||
` nardo86/zoneminder`
|
` nardo86/zoneminder`
|
||||||
|
|
||||||
The SELFSIGNED flag will , the FQDN will be used for configuring Apache2 and, in case of using the SWAG certificate, find the correct folder and the /config folder will contain msmtp and mysql configuration.
|
The FQDN will be used for configuring Apache2; the SELFSIGNED flag will generate a selfsigned certificate if needed else, in case of using the SWAG certificate, the system find the correct folder.
|
||||||
|
The /config folder will contain msmtp and mysql configuration.
|
||||||
|
|
||||||
The shm-size will be the quantity of RAM dedicated to /dev/shm.*
|
The shm-size will be the quantity of RAM dedicated to /dev/shm, the size depends on the number and settings of the video sources to monitor, check ZoneMinder configuration for further information.*
|
||||||
|
|
||||||
**be sure to not reserve too much RAM to this machine or the docker server wil start to paging and eventually becoming unresponsible**
|
**be sure to not reserve too much RAM to this machine or the docker server wil start to paging and eventually becoming unresponsible**
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo $TZ > /etc/timezone
|
#echo $TZ > /etc/timezone
|
||||||
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
echo "Configuring MariaDBPath"
|
echo "Configuring MariaDBPath"
|
||||||
if [ ! -d /config/mysql ]; then
|
if [ ! -d /config/mysql ]; then
|
||||||
|
@ -54,7 +55,7 @@ fi
|
||||||
|
|
||||||
echo "Checking Timezones"
|
echo "Checking Timezones"
|
||||||
RESULT=$(cat /etc/mysql/my.cnf| grep default-time-zone)
|
RESULT=$(cat /etc/mysql/my.cnf| grep default-time-zone)
|
||||||
if [ "$RESULT" = "" ]; then
|
if [ "$RESULT" != "default-time-zone=$(cat /etc/timezone)" ]; then
|
||||||
echo "Set Mysql timezone"
|
echo "Set Mysql timezone"
|
||||||
printf "[mysqld]\n default-time-zone=$(cat /etc/timezone)" >> /etc/mysql/my.cnf
|
printf "[mysqld]\n default-time-zone=$(cat /etc/timezone)" >> /etc/mysql/my.cnf
|
||||||
/etc/init.d/mysql restart
|
/etc/init.d/mysql restart
|
||||||
|
@ -65,9 +66,9 @@ if [ "$RESULT" = "" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RESULT=$(cat /etc/php/*/apache2/php.ini| grep "date.timezone =")
|
RESULT=$(cat /etc/php/*/apache2/php.ini| grep "date.timezone =")
|
||||||
if [ "$RESULT" = ";date.timezone =" ]; then
|
if [ "$RESULT" != "date.timezone = $(sed 's/\\/\//' /etc/timezone)" ]; then
|
||||||
echo "Set Php timezone"
|
echo "Set Php timezone"
|
||||||
sed -i "s/;date.timezone =/date.timezone = $(sed 's/\//\\\//' /etc/timezone)/g" /etc/php/*/apache2/php.ini
|
sed -i "s/;date.timezone =/date.timezone = $(sed 's/\\/\//' /etc/timezone)/g" /etc/php/*/apache2/php.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Checking MSMTP configuration"
|
echo "Checking MSMTP configuration"
|
||||||
|
@ -92,7 +93,7 @@ ln -s /config/msmtprc /etc/msmtprc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$SELFSIGNED" = "0" ]; then
|
if [ "$SELFSIGNED" = "0" ]; then
|
||||||
echo "Configuro collegamento a swag"
|
echo "Linking to SWAG"
|
||||||
sed -i -e 's,/etc/ssl/certs/ssl-cert-snakeoil.pem,/sslcert/live/'$FQDN'/cert.pem,g' /etc/apache2/sites-available/default-ssl.conf
|
sed -i -e 's,/etc/ssl/certs/ssl-cert-snakeoil.pem,/sslcert/live/'$FQDN'/cert.pem,g' /etc/apache2/sites-available/default-ssl.conf
|
||||||
sed -i -e 's,/etc/ssl/private/ssl-cert-snakeoil.key,/sslcert/live/'$FQDN'/privkey.pem,g' /etc/apache2/sites-available/default-ssl.conf
|
sed -i -e 's,/etc/ssl/private/ssl-cert-snakeoil.key,/sslcert/live/'$FQDN'/privkey.pem,g' /etc/apache2/sites-available/default-ssl.conf
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue