forked from zabbix/zabbix-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zabbix-server-docker-compose.yaml
105 lines (95 loc) · 2.92 KB
/
zabbix-server-docker-compose.yaml
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
version: '2.4'
services:
zabbix-server:
image: zabbix/zabbix-server-pgsql:ubuntu-5.0.16
cpu_quota: 30000 # 1000 = 1%
mem_reservation: 256M
ports:
- "10051:10051"
volumes:
- /etc/localtime:/etc/localtime: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
- ./zbx_env/var/lib/zabbix/snmptraps:/var/lib/zabbix/snmptraps:ro
ulimits:
nproc: 65535
nofile:
soft: 20000
hard: 40000
env_file:
- ./deploy_configs/env_vars/.env_db_pgsql
- ./deploy_configs/env_vars/.env_srv
depends_on:
- postgres-server
networks:
zbx_net_backend:
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
restart: always
zabbix-agent:
build:
context: ./Dockerfiles/agent/ubuntu
cache_from:
- ubuntu:focal
args:
BUILD_BASE_IMAGE: zabbix/zabbix-build-pgsql:ubuntu-5.0.17
image: zabbix-agent:ubuntu-local
cpu_quota: 30000 # 1000 = 1%
mem_reservation: 32M
ports:
- "10050:10050"
volumes:
- /etc/localtime:/etc/localtime:ro
- ./application_configs/02_zabbix_agent_linux/user_scripts:/user_scripts: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:
- ./deploy_configs/env_vars/.env_agent
privileged: true
pid: "host"
networks:
zbx_net_backend:
aliases:
- zabbix-server-agent
stop_grace_period: 5s
restart: always
postgres-server:
image: timescale/timescaledb:2.5.1-pg12
cpu_quota: 90000 # 1000 = 1%
mem_reservation: 256M
ports:
- "5432:5432"
volumes:
- ./zbx_env/var/lib/postgresql/data:/var/lib/postgresql/data:rw
env_file:
- ./deploy_configs/env_vars/.env_db_pgsql
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
stop_grace_period: 1m
networks:
zbx_net_backend:
restart: always
networks:
zbx_net_backend:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
ipam:
driver: default
config:
- subnet: 172.16.239.0/24