Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployment on docker swarm #3349

Open
SkazochnikZlodey opened this issue Sep 12, 2021 · 2 comments
Open

deployment on docker swarm #3349

SkazochnikZlodey opened this issue Sep 12, 2021 · 2 comments
Labels

Comments

@SkazochnikZlodey
Copy link

SkazochnikZlodey commented Sep 12, 2021

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
Copy link

welcome bot commented Sep 12, 2021

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
Copy link

stale bot commented Apr 16, 2022

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.

@stale stale bot added the stale label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 participant