docker-compose.yaml
services:
zabbix-pgsql:
image: postgres:16.4
container_name: zabbix-pgsql
network_mode: host
restart: always
environment:
TZ: Asia/Shanghai
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres@2024
POSTGRES_INITDB_ARGS: --data-checksums
# POSTGRES_INITDB_WALDIR: /var/lib/postgresql/data/pgdata
volumes:
- /etc/timezone:/etc/timezone
- ./data/zabbix-pgsql:/var/lib/postgresql/data
# zabbix server
zabbix-server-pgsql:
image: zabbix/zabbix-server-pgsql:ubuntu-7.0.3
container_name: zabbix-server-pgsql
restart: unless-stopped
network_mode: host
# init: true
volumes:
- /etc/localtime:/etc/localtime
# - ./data/zabbix-server:/etc/zabbix # environment自动生成文件进入/etc/zabbix
- ./data/zabbix-server-alertscripts:/usr/lib/zabbix/alertscripts
environment:
# - DB_SERVER_HOST=zabbix-postgres
- DB_SERVER_HOST=10.100.52.251
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=postgres@2024
# - ZBX_JAVAGATEWAY=zabbix-java-gateway
- ZBX_JAVAGATEWAY=10.100.52.251
- ZBX_JAVAGATEWAY_ENABLE=true
- ZBX_JAVAGATEWAYPORT=10052
- ZBX_VMWARECACHESIZE=1024M
- ZBX_CACHESIZE=256M
depends_on:
- zabbix-pgsql
# zabbix webui
zabbix-web-nginx-pgsql:
image: zabbix/zabbix-web-nginx-pgsql:ubuntu-7.0.3
restart: always
network_mode: host
container_name: zabbix-web-nginx-pgsql
environment:
- DB_SERVER_HOST=10.100.52.251
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres@2024
- ZBX_SERVER_HOST=10.100.52.251
- PHP_TZ=Asia/Shanghai
# ports:
# - 8080:8080
volumes:
- /etc/localtime:/etc/localtime
- ./ext/fonts/DejaVuSans.ttf:/usr/share/zabbix/assets/fonts/DejaVuSans.ttf
depends_on:
- zabbix-pgsql
- zabbix-server-pgsql
# zabbix agent
zabbix-agent:
image: zabbix/zabbix-agent:ubuntu-7.0.3
restart: always
network_mode: host
container_name: zabbix-agent
# ports:
# - 10050:10050
volumes:
- /etc/localtime:/etc/localtime
environment:
- ZBX_HOSTNAME=Zabbix server
- ZBX_SERVER_HOST=zabbix-server-mysql
- ZBX_SERVER_PORT=10051
# zabbix java 网关
zabbix-java-gateway:
image: zabbix/zabbix-java-gateway:ubuntu-7.0.3
restart: always
network_mode: host
container_name: zabbix-java-gateway
volumes:
- /etc/localtime:/etc/localtime