使用docker-compose安装zabbix

version: '2'

services:

zabbix-mysql:

container_name: zabbix-mysql

image: mysql:5.7

restart: always

ports:

- "3306:3306"

environment:

MYSQL_ROOT_PASSWORD: root

MYSQL_USER: zabbix

MYSQL_PASSWORD: zabbix

MYSQL_DATABASE: zabbix

command:

--character-set-server=utf8

--collation-server=utf8_bin

volumes:

- /home/zhangm/zabbix/mysql-data:/var/lib/mysql

networks:

- zabbix

 

zabbix-server:

container_name: zabbix-server

image: zabbix/zabbix-server-mysql:centos-trunk

ports:

- "10051:10051"

restart: always

environment:

DB_SERVER_HOST: zabbix-mysql

MYSQL_USER: zabbix

MYSQL_DATABASE: zabbix

MYSQL_PASSWORD: zabbix

volumes:

- /etc/localtime:/etc/localtime:ro

- /home/zhangm/zabbix/alertscripts:/usr/lib/zabbix/alertscripts

- /home/zhangm/zabbix/externalscripts:/usr/lib/zabbix/externalscripts

depends_on:

- zabbix-mysql

links:

- zabbix-mysql

networks:

- zabbix

 

zabbix-nginx:

container_name: zabbix-nginx

image: zabbix/zabbix-web-nginx-mysql

restart: always

ports:

- "80:80"

depends_on:

- zabbix-mysql

links:

- zabbix-mysql

environment:

DB_SERVER_HOST: zabbix-mysql

MYSQL_USER: zabbix

MYSQL_PASSWORD: zabbix

MYSQL_DATABASE: zabbix

ZBX_SERVER_HOST: zabbix-server

PHP_TZ: Asia/Shanghai

networks:

- zabbix

networks:

zabbix:

driver: bridge


 

# docker run --name zabbix-agent --network zabbix -e ZBX_HOST_NAME=agentd -e ZBX_SERVER_HOST=zabbix-server -d zabbix/zabbix-agent

你可能感兴趣的:(使用docker-compose安装zabbix)