-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdocker-compose_v5.4.yml
233 lines (227 loc) · 6.54 KB
/
docker-compose_v5.4.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
version: "3.8"
services:
zabbix-server:
image: zabbix/zabbix-server-pgsql:alpine-5.4-latest
container_name: zabbix-server
restart: unless-stopped
ports:
- "10051:10051"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./zbx_env/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:ro
- ./zbx_env/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts:ro
- ./zbx_env/var/lib/zabbix/export:/var/lib/zabbix/export:rw
- ./zbx_env/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
- ./zbx_env/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro
- ./zbx_env/var/lib/zabbix/mibs:/var/lib/zabbix/mibs:ro
links:
- postgres-server:postgres-server
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
deploy:
resources:
limits:
cpus: "0.70"
memory: 1G
reservations:
cpus: "0.5"
memory: 512M
env_file:
- ./env_vars/.env_db_pgsql
- ./env_vars/.env_srv
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
depends_on:
- postgres-server
networks:
zbx_net_backend:
ipv4_address: 172.16.239.101
aliases:
- zabbix-server
- zabbix-server-pgsql
- zabbix-server-alpine-pgsql
- zabbix-server-pgsql-alpine
zbx_net_frontend:
ipv4_address: 172.16.238.101
stop_grace_period: 30s
sysctls:
- net.ipv4.ip_local_port_range=1024 65000
- net.ipv4.conf.all.accept_redirects=0
- net.ipv4.conf.all.secure_redirects=0
- net.ipv4.conf.all.send_redirects=0
labels:
com.zabbix.description: "Zabbix server with PostgreSQL database support"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-server"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "alpine"
zabbix-web-nginx-pgsql:
container_name: zabbix-web
image: zabbix/zabbix-web-nginx-pgsql:alpine-5.4-latest
restart: unless-stopped
ports:
- "8080:8080"
- "8443:8443"
links:
- postgres-server:postgres-server
- zabbix-server:zabbix-server
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./zbx_env/etc/ssl/nginx:/etc/ssl/nginx:ro
- ./zbx_env/usr/share/zabbix/modules/:/usr/share/zabbix/modules/:ro
deploy:
resources:
limits:
cpus: "0.70"
memory: 512M
reservations:
cpus: "0.5"
memory: 256M
env_file:
- ./env_vars/.env_db_pgsql
- ./env_vars/.env_web
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
depends_on:
- postgres-server
- zabbix-server
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
networks:
zbx_net_backend:
ipv4_address: 172.16.239.102
aliases:
- zabbix-web-nginx-pgsql
- zabbix-web-nginx-alpine-pgsql
- zabbix-web-nginx-pgsql-alpine
zbx_net_frontend:
ipv4_address: 172.16.238.102
ingress_gateway:
aliases:
- zabbix-web-apache-pgsql
- zabbix-web-apache-alpine-pgsql
- zabbix-web-apache-pgsql-alpine
stop_grace_period: 10s
sysctls:
- net.core.somaxconn=65535
labels:
com.zabbix.description: "Zabbix frontend on Nginx web-server with PostgreSQL database support"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-frontend"
com.zabbix.webserver: "nginx"
com.zabbix.dbtype: "pgsql"
com.zabbix.os: "alpine"
zabbix-agent:
container_name: zabbix-agent
image: zabbix/zabbix-agent2:alpine-5.4-latest
ports:
- "10051:10051"
- "10050:10050"
links:
- zabbix-server:zabbix-server
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./zbx_env/etc/zabbix/zabbix_agentd.d:/etc/zabbix/zabbix_agentd.d:ro
- ./zbx_env/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
- ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
- ./zbx_env/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro
env_file:
- ./env_vars/.env_agent
privileged: true
pid: "host"
networks:
zbx_net_backend:
ipv4_address: 172.16.239.103
aliases:
- zabbix-agent
- zabbix-agent-passive
- zabbix-agent-alpine
stop_grace_period: 5s
labels:
com.zabbix.description: "Zabbix agent"
com.zabbix.company: "Zabbix LLC"
com.zabbix.component: "zabbix-agentd"
com.zabbix.os: "alpine"
postgres-server:
container_name: zabbix-db
image: postgres:13.4-alpine3.14
restart: unless-stopped
volumes:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
- ./.ZBX_DB_CA_FILE:/run/secrets/root-ca.pem:ro
- ./.ZBX_DB_CERT_FILE:/run/secrets/server-cert.pem:ro
- ./.ZBX_DB_KEY_FILE:/run/secrets/server-key.pem:ro
env_file:
- ./env_vars/.env_db_pgsql
secrets:
- POSTGRES_USER
- POSTGRES_PASSWORD
stop_grace_period: 1m
networks:
zbx_net_backend:
ipv4_address: 172.16.239.104
aliases:
- postgres-server
- pgsql-server
- pgsql-database
# grafana-server:
# container_name: grafana-server
# image: grafana/grafana-oss:latest
# networks:
# zbx_net_backend:
# ipv4_address: 172.16.239.105
# aliases:
# - grafana-server
# zbx_net_frontend:
# ipv4_address: 172.16.238.105
# ingress_gateway:
# aliases:
# - grafana-server
# restart: always
# ports:
# - '3000:3000'
# user: '472'
# volumes:
# - './grafana/lib:/var/lib/grafana'
# - './grafana/log:/var/log/grafana'
# environment:
# GF_INSTALL_PLUGINS: alexanderzobnin-zabbix-app
networks:
zbx_net_frontend:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
zbx_net_backend:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
internal: true
ipam:
driver: default
config:
- subnet: 172.16.239.0/24
ingress_gateway:
external: true
name: ingress_gateway
secrets:
POSTGRES_USER:
file: ./env_vars/.POSTGRES_USER
POSTGRES_PASSWORD:
file: ./env_vars/.POSTGRES_PASSWORD