2021-02-07 10:26:49 +01:00
# ZONEMINDER
2021-01-12 18:33:21 +01:00
2021-02-07 22:16:10 +01:00
This is a simple debian image with the ZoneMinder installed following the official instructions https://wiki.zoneminder.com/Debian_10_Buster_with_Zoneminder_1.34.x_from_ZM_Repo.
2021-02-07 10:32:04 +01:00
2021-02-07 10:26:49 +01:00
Because of the ssmtp deprecation the mail server installed is msmtp and a default configuration file prepared for GMail will be created in /config/msmtprc.
2021-02-07 10:32:04 +01:00
2021-02-07 10:26:49 +01:00
Furthermore the image is prepared for working with SWAG(let's encrypt) image or there is an environment for the self-signed certificate option.
Image available at https://hub.docker.com/r/nardo86/docker
Feel free to consider donating if my work helped you! https://paypal.me/ErosNardi
_Tested on my Raspberry Pi 4 with SWAG_
2021-01-12 18:33:21 +01:00
**USAGE**
2021-02-07 10:26:49 +01:00
Just run the image publishing the port and setting the ENV variables, the shm dedicated and mounting the folder you wish to map.
`docker run -d \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` --name=ZoneMinder \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -p 443:443/tcp \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -e TZ=Europe/Rome \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -e SELFSIGNED=0 \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -e FQDN=your.fqdn \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` --shm-size=1.5g \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -v /mystorage/ZoneMinder/config:/config \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -v /mystorage/ZoneMinder/zmcache:/var/cache/zoneminder \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -v /mystorage/Swag/etc/letsencrypt/live:/sslcert/live \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` -v /mystorage/Swag/etc/letsencrypt/archive:/sslcert/archive \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` --restart unless-stopped \`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
` 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 shm-size will be the quantity of RAM dedicated to /dev/shm.*
2021-02-07 10:32:04 +01:00
2021-02-07 10:26:49 +01:00
**be sure to not reserve too much RAM to this machine or the docker server wil start to paging and eventually becoming unresponsible**
To access the Zoneminder gui, browse to: https://your.fqdn:443/zm
If you need to transfer your data from another instance this method worked for me https://forums.zoneminder.com/viewtopic.php?t=17071:
Backup the old DB
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
`root@oldSystem# mysqldump -p zm > /config/zm-dbbackup.sql`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
Restore into the new DB
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
`root@newSystem# mysql -p zm < /config/zm-dbbackup.sql`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
Sync folders
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
`root@newSystem# rsync -r -t -p -o -g -v --progress --delete user@oldSystem:/var/cache/zoneminder/* /var/cache/zoneminder/`
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
Init / cleanup
2021-02-07 10:31:16 +01:00
2021-02-07 10:26:49 +01:00
`root@newSystem# zmaudit.pl`
2021-01-12 18:33:21 +01:00
**EXTRA OPTIONS**
2021-02-07 10:26:49 +01:00
Environment variable used for the configuration
Variable|Description|Default
--------|-----------|-------
SELFSIGNED|switch between using a self-signed certificate and the one in sslcert/live folder|0
FQDN|the FQDN Apache2 will be listening to, sslcert/live subfolder if SELFSIGNED is 0 |localhost