-
Notifications
You must be signed in to change notification settings - Fork 31
/
docker-compose.yml
120 lines (117 loc) · 3.03 KB
/
docker-compose.yml
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
version: '3.7'
services:
mariadbseed:
image: cvb941/mariadb-galera-swarm-rpi:10.1
environment:
- XTRABACKUP_PASSWORD_FILE=/run/secrets/xtrabackup_password
- MYSQL_USER=user123
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
- MYSQL_DATABASE=homeassistant
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
- NODE_ADDRESS=^10.0.*.*
- TRACE=y
command: seed
deploy:
replicas: 1
secrets:
- xtrabackup_password
- mysql_password
- mysql_root_password
volumes:
- mysql-data:/var/lib/mysql
mariadbnode:
image: cvb941/mariadb-galera-swarm-rpi:10.1
environment:
- XTRABACKUP_PASSWORD_FILE=/run/secrets/xtrabackup_password
- MYSQL_USER=user123
- MYSQL_PASSWORD_FILE=/run/secrets/mysql_password
- MYSQL_DATABASE=homeassistant
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password
- NODE_ADDRESS=^10.0.*.*
- HEALTHY_WHILE_BOOTING=1
- TRACE=y
command: node mariadbseed,mariadbnode
deploy:
replicas: 0
endpoint_mode: dnsrr
secrets:
- xtrabackup_password
volumes:
- mysql-data:/var/lib/mysql
ports:
- target: 3306
published: 3306
protocol: tcp
mode: host
homeassistant:
container_name: home-assistant
image: homeassistant/raspberrypi3-homeassistant:0.95.4
volumes:
- /var/hacluster/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
restart: always
ports:
- target: 8123
published: 8123
protocol: tcp
# mode: host
depends_on:
- mariadbnode
- mosquitto
deploy:
replicas: 0
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
restart: always
ports:
- "1883:1883"
- "9001:9001"
volumes:
- /var/hacluster/mosquitto:/mosquitto
deploy:
replicas: 1
portainer:
image: portainer/portainer
restart: always
container_name: "portainer-app"
ports:
- 9000:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /opt/portainer/data:/data
networks:
- agent_network
portainer_agent:
image: portainer/agent
environment:
# REQUIRED: Should be equal to the service name prefixed by "tasks." when
# deployed inside an overlay network
AGENT_CLUSTER_ADDR: tasks.portainer_agent
# AGENT_PORT: 9001
# LOG_LEVEL: debug
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
networks:
- agent_network
deploy:
mode: global
placement:
constraints: [node.platform.os == linux]
networks:
agent_network:
driver: overlay
secrets:
xtrabackup_password:
file: .secrets/xtrabackup_password
mysql_password:
file: .secrets/mysql_password
mysql_root_password:
file: .secrets/mysql_root_password
volumes:
mysql-data:
name: '{{.Service.Name}}-{{.Task.Slot}}-data'
driver: local