forked from Ulexus/docker-zoneminder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml.swarm
103 lines (102 loc) · 2.55 KB
/
docker-compose.yml.swarm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# quantumobject/docker-zoneminder:1.31.44 build from https://github.com/marcelo-ochoa/docker-zoneminder
# docker build -t "quantumobject/docker-zoneminder:1.31.44" -f Dockerfile .
# dockercloud/haproxy:1.6.7.1 build from https://github.com/marcelo-ochoa/dockercloud-haproxy
version: '3.2'
services:
db:
image: mysql/mysql-server:5.7
networks:
- net
volumes:
- /home/data/zm/mysql:/var/lib/mysql
- $PWD/conf/mysql:/etc/mysql:ro
environment:
- TZ=America/Argentina/Buenos_Aires
- MYSQL_USER=zmuser
- MYSQL_PASSWORD=zmpass
- MYSQL_DATABASE=zm
- MYSQL_ROOT_PASSWORD=mysqlpsswd
- MYSQL_ROOT_HOST=%
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
web:
image: quantumobject/docker-zoneminder:1.31.44
networks:
- net
volumes:
- /var/empty
- /home/data/zm/backups:/var/backups
- /home/data/zm/zoneminder:/var/cache/zoneminder
- type: tmpfs
target: /dev/shm
environment:
- TZ=America/Argentina/Buenos_Aires
- VIRTUAL_HOST=zm.localhost, stream0.localhost
- SERVICE_PORTS="80"
- ZM_SERVER_HOST=node.0
- ZM_DB_HOST=db
deploy:
mode: replicated
replicas: 0
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
depends_on:
- db
stream:
image: quantumobject/docker-zoneminder:1.31.44
networks:
- net
volumes:
- /var/empty
- /home/data/zm/backups:/var/backups
- /home/data/zm/zoneminder:/var/cache/zoneminder
- type: tmpfs
target: /dev/shm
environment:
- TZ=America/Argentina/Buenos_Aires
- VIRTUAL_HOST=stream{{.Task.Slot}}.localhost
- SERVICE_PORTS="80"
- ZM_SERVER_HOST=node.{{.Task.Slot}}
- ZM_DB_HOST=db
deploy:
mode: replicated
replicas: 0
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
depends_on:
- web
lb:
image: dockercloud/haproxy:1.6.7.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- target: 80
published: 80
protocol: tcp
networks:
- net
environment:
- TZ=America/Argentina/Buenos_Aires
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
depends_on:
- web
networks:
net:
driver: overlay