Some notes about it:
I'm using an external NFS server for event storage.
I'm using an external mariadb server as a database.
The method of adding `shm=2G` to the compose file doesn't work in swarm mode, hence the tmpfs volume. I had to dive a LONG way into docker to find that information.
Code: Select all
version: "3.8"
services:
# Zoneminder Docker-Compose Configuration
zoneminder-4k:
restart: always
hostname: node0
image: zoneminderhq/zoneminder:latest-ubuntu18.04
ports:
- '30080:80/tcp'
environment:
- TZ=$TZ
- ZM_DB_USER=$ZM_DB_USER
- ZM_DB_PASS=$ZM_DB_PASS
- ZM_DB_NAME=$ZM_DB_NAME
- ZM_DB_HOST=$ZM_DB_HOST
- ZM_SERVER_HOST=node0
volumes:
- zoneminder_data:/var/cache/zoneminder/events:rw
- type: tmpfs
target: /dev/shm
tmpfs:
size: 6144000000 #6GB
deploy:
placement:
constraints:
- node.role==worker
- node.platform.arch==x86_64
zoneminder-3M:
restart: always
hostname: node2
image: zoneminderhq/zoneminder:latest-ubuntu18.04
ports:
- '30082:80/tcp'
environment:
- TZ=$TZ
- ZM_DB_USER=$ZM_DB_USER
- ZM_DB_PASS=$ZM_DB_PASS
- ZM_DB_NAME=$ZM_DB_NAME
- ZM_DB_HOST=$ZM_DB_HOST
- ZM_SERVER_HOST=node2
volumes:
- zoneminder_data:/var/cache/zoneminder/events:rw
- type: tmpfs
target: /dev/shm
tmpfs:
size: 4096000000 #4GB
deploy:
placement:
constraints:
- node.role==worker
- node.platform.arch==x86_64
zoneminder-1440p:
restart: always
hostname: node1
image: zoneminderhq/zoneminder:latest-ubuntu18.04
ports:
- '30081:80/tcp'
environment:
- TZ=$TZ
- ZM_DB_USER=$ZM_DB_USER
- ZM_DB_PASS=$ZM_DB_PASS
- ZM_DB_NAME=$ZM_DB_NAME
- ZM_DB_HOST=$ZM_DB_HOST
- ZM_SERVER_HOST=node1
volumes:
- zoneminder_data:/var/cache/zoneminder/events:rw
- type: tmpfs
target: /dev/shm
tmpfs:
size: 4096000000 #4GB
deploy:
placement:
constraints:
- node.role==worker
- node.platform.arch==x86_64
volumes:
zoneminder_data:
driver: local
driver_opts:
device: :/srv/nfs/zoneminder
o: addr=${NAS_HOST},rw,vers=4
type: nfs
1) Accessing the WebUI from http://fqdn.org:30080/zm does not let me see the live images
2) Accessing the API from the http://fqdn.org:30080/zm using ZMNinja ALSO doesn't let me see the images.
3) There is no good way to programmatically scale the number of servers and automatically populate the database with them. This can be manually done, but would be slick if one could just scale the number of instances and have it automatically create the servers (ZM_SERVER_HOST).
I think 1 and 2 are related to this: viewtopic.php?t=29255 but I'm not sure how to make that persistent and scalable.