forked from lippserd/docker-compose-icinga
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (124 loc) · 4.8 KB
/
docker-compose.yml
File metadata and controls
134 lines (124 loc) · 4.8 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
version: '3.7'
x-logging:
&default-logging
driver: "json-file"
options:
max-file: "10"
max-size: "1M"
x-icinga2-environment:
&icinga2-environment
ICINGA_CN: icinga2
ICINGA_MASTER: 1
networks:
default:
name: icinga-playground
services:
# The Icinga 2 docker image does not support configuration via env vars at the moment.
# So, we have to ship some configs with this little init container. Referenced in depends_on of the icinga2 service.
init-icinga2:
command: [ "/config/init-icinga2.sh" ]
environment: *icinga2-environment
image: icinga/icinga2
logging: *default-logging
volumes:
- icinga2:/data
- ./icingadb.conf:/config/icingadb.conf
- ./icingaweb-api-user.conf:/config/icingaweb-api-user.conf
- ./init-icinga2.sh:/config/init-icinga2.sh
icinga2:
command: [ "sh", "-c", "sleep 5 ; icinga2 daemon" ]
depends_on:
- icingadb-redis
- init-icinga2
environment: *icinga2-environment
image: icinga/icinga2:master
logging: *default-logging
ports:
- 5665:5665
volumes:
- icinga2:/data
- ./icinga2.conf.d:/custom_data/custom.conf.d
icingadb:
environment:
ICINGADB_DATABASE_HOST: mysql
ICINGADB_DATABASE_PORT: 3306
ICINGADB_DATABASE_DATABASE: icingadb
ICINGADB_DATABASE_USER: icingadb
ICINGADB_DATABASE_PASSWORD: ${ICINGADB_MYSQL_PASSWORD:-icingadb}
ICINGADB_REDIS_ADDRESS: icingadb-redis:6379
depends_on:
- mysql
- icingadb-redis
image: icinga/icingadb:master
logging: *default-logging
# Restart Icinga DB container automatically since we have to wait for the database to be ready.
# Please note that this needs a more sophisticated solution.
restart: unless-stopped
icingadb-redis:
image: redis
logging: *default-logging
icingaweb:
build:
context: ./env/icingaweb2
depends_on:
- mysql
environment:
icingaweb.authentication.icingaweb2.backend: db
icingaweb.authentication.icingaweb2.resource: icingaweb-mysql
icingaweb.config.global.config_backend: db
icingaweb.config.global.config_resource: icingaweb-mysql
icingaweb.config.global.module_path: /usr/share/icingaweb2/modules
icingaweb.config.logging.log: php
icingaweb.config.themes.default: Legacy
icingaweb.enabledModules: director, icingadb, incubator
icingaweb.groups.icingaweb2.backend: db
icingaweb.groups.icingaweb2.resource: icingaweb-mysql
icingaweb.modules.icingadb.config.icingadb.resource: icingadb
icingaweb.modules.icingadb.redis.redis1.host: icingadb-redis
icingaweb.modules.icingadb.redis.redis1.port: 6379
icingaweb.modules.icingadb.commandtransports.icinga2.host: icinga2
icingaweb.modules.icingadb.commandtransports.icinga2.port: 5665
icingaweb.modules.icingadb.commandtransports.icinga2.password: ${ICINGAWEB_ICINGA2_API_USER_PASSWORD:-icingaweb}
icingaweb.modules.icingadb.commandtransports.icinga2.transport: api
icingaweb.modules.icingadb.commandtransports.icinga2.username: icingaweb
icingaweb.passwords.icingaweb2.icingaadmin: icinga
icingaweb.resources.icingadb.charset: utf8mb4
icingaweb.resources.icingadb.db: mysql
icingaweb.resources.icingadb.dbname: icingadb
icingaweb.resources.icingadb.host: mysql
icingaweb.resources.icingadb.password: ${ICINGADB_MYSQL_PASSWORD:-icingadb}
icingaweb.resources.icingadb.type: db
icingaweb.resources.icingadb.username: ${ICINGADB_MYSQL_USER:-icingadb}
icingaweb.resources.icingaweb-mysql.charset: utf8mb4
icingaweb.resources.icingaweb-mysql.db: mysql
icingaweb.resources.icingaweb-mysql.dbname: icingaweb
icingaweb.resources.icingaweb-mysql.host: mysql
icingaweb.resources.icingaweb-mysql.password: ${ICINGAWEB_MYSQL_PASSWORD:-icingaweb}
icingaweb.resources.icingaweb-mysql.type: db
icingaweb.resources.icingaweb-mysql.username: icingaweb
icingaweb.roles.Administrators.groups: Administrators
icingaweb.roles.Administrators.permissions: '*'
icingaweb.roles.Administrators.users: icingaadmin
logging: *default-logging
ports:
- 8080:8080
# Restart Icinga Web container automatically since we have to wait for the database to be ready.
# Please note that this needs a more sophisticated solution.
restart: unless-stopped
volumes:
- icingaweb:/data
mysql:
image: mariadb
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
ICINGAWEB_MYSQL_PASSWORD: ${ICINGAWEB_MYSQL_PASSWORD:-icingaweb}
ICINGADB_MYSQL_PASSWORD: ${ICINGADB_MYSQL_PASSWORD:-icingadb}
logging: *default-logging
volumes:
- mysql:/var/lib/mysql
- ./env/mysql/:/docker-entrypoint-initdb.d/
volumes:
icinga2:
icingaweb:
mysql: