ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
5.2k stars 1.23k forks source link

deployment on docker swarm #3349

Open SkazochnikZlodey opened 3 years ago

SkazochnikZlodey commented 3 years ago

Describe Your Environment 1.36.4 image zoneminderhq/zoneminder:latest-ubuntu18.04 Describe the bug It was real challenge to deploy zoneminder in dowcker swarm + external mysql.

especially to create db !! can you add sql file to create db ? zmdb.zip here is part of docker-compoase.yml file for docker swarm:

version: "3.7"

services:
  zoneminder:
    image: zoneminderhq/zoneminder:latest-ubuntu18.04
#    image: dlandon/zoneminder
#    image: zoneminderhq/zoneminder:latest-el7
#    shm_size: "512m"
#  ALTER USER 'zoneminder'@'%' IDENTIFIED WITH mysql_native_password BY 'Z0neMinder'
# zoneminder db creation : https://wiki.zoneminder.com/MySQL
#mysql -u root -p -e "drop database zm;"
#mysql -u root -p -e "create database zm;"
# mysql -u root -p < ./zm_create.sql
# mysql -u root -p -e "grant all on zm.* to 'zm'@% identified by 'ZoneMinderPassw0rd';"
# mysqladmin -u root -p reload
#
    deploy:
      replicas: 1
      resources:
        limits:
#          cpus: '4'
          memory: 4096M
        reservations:
#          cpus: '2'
          memory: 2048M
#      shm_size: 4096M
      restart_policy:
        condition: any
      labels:
        - traefik.enable=true
        - traefik.docker.lbswarm=true
        - traefik.docker.network=traefiknet
        - traefik.http.routers.zoneminder.rule=Host(`ipcam.it.com`)
        - traefik.http.routers.zoneminder.tls=true
        - traefik.http.routers.zoneminder.tls.certresolver=le
        - traefik.http.routers.zoneminder.entrypoints=websecure
        - traefik.http.routers.zoneminder.service=zoneminder
        - traefik.http.services.zoneminder.loadbalancer.server.port=80
        - traefik.http.services.zoneminder.loadbalancer.server.scheme=http
        - traefik.http.services.zoneminder.loadbalancer.passhostheader=true
        - traefik.http.services.zoneminder.loadbalancer.sticky=true

#    ports:
#     - "10081:80"       # HTTP
#      - "10443:443"     # HTTPS
    environment:
      - TZ=Europe/Kiev
      - ZM_DB_USER=zm
      - ZM_DB_PASS=ZoneM
      - ZM_DB_NAME=zm
      - ZM_DB_HOST=192.168.144.20
    volumes:
#      - /externalslow/services/zoneminder/config:/config
      - /externalslow/services/zoneminder/data/events:/var/cache/zoneminder/events
      - /externalslow/services/zoneminder/data/images:/var/cache/zoneminder/images

      - type: tmpfs
        target: /dev/shm
        tmpfs:
          size: 524288000

      - /externalslow/services/zoneminder/logs:/var/log/zoneminder

    networks:
#      - zoneminder_network
      - traefiknet
welcome[bot] commented 3 years ago

Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.